DX Application Performance Management

Expand all | Collapse all

How can I exclude agents that don't match a pattern?

Jump to Best Answer
  • 1.  How can I exclude agents that don't match a pattern?

    Posted 03-10-2017 09:24 AM

    Let's say I only want to allow agents on servers that start with "one" or "two".  My loadbalancing.xml looks like this:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <loadbalancing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="loadbalancing0.1.xsd">

    <!-- Block **** -->
        <agent-collector name="Block ****">
            <agent-specifier>^(?!(one|two))\|.*\|.*</agent-specifier>
            <include>
            </include>
        </agent-collector>
    </loadbalancing>

    and yet I still get agents on servers with hostnames like "04599598ae29" connecting.

     

    Does the regex engine in use not support zero width assertions or something, or is there something else I'm missing?



  • 2.  Re: How can I exclude agents that don't match a pattern?

    Posted 03-10-2017 09:33 AM

    OK, spot the deliberate error!

     

    (I'll give you a clue, it's everything!)

     

    Just testing without the stupid mistake, if it works I'll revoke this question...



  • 3.  Re: How can I exclude agents that don't match a pattern?

    Posted 03-10-2017 09:45 AM

    Yeah, it was the missing .* in the host part of the regex.  Oops.



  • 4.  Re: How can I exclude agents that don't match a pattern?
    Best Answer

    Posted 03-10-2017 09:46 AM

    If anyone happens across this question because they don't know how to do it, the correct answer is:

     

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <loadbalancing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="loadbalancing0.1.xsd">

    <!-- Block **** -->
        <agent-collector name="Block ****">
            <agent-specifier>^(?!(one|two)).*\|.*\|.*</agent-specifier>
            <include>
            </include>
        </agent-collector>
    </loadbalancing>