Forum Discussion

yuhuang's avatar
yuhuang
Icon for Nimbostratus rankNimbostratus
Jan 12, 2023

http monitor receive string parsing

I am trying to setup on BigIp http monitor using regex in the receive string.

The receive string contains something like:

<s:key name="B29F4327-8F4D-45B7-B962-493BB6DC222C">

              <s:dict>

                <s:key name="label">saaa03</s:key>

                <s:key name="mgmt_uri">https://saaa03.prod.com:8089</s:key>

                <s:key name="mgmt_uri_alias">https://172.25.4.208:8089</s:key>

                <s:key name="status">Up</s:key>

              </s:dict>

            </s:key>

            <s:key name="E89A560F-7DFB-4C2F-9846-B8C77D623CF5">

              <s:dict>

                <s:key name="label">saaa02</s:key>

                <s:key name="last_conf_replication">Wed Jan 11 14:15:07 2023</s:key>

                <s:key name="mgmt_uri">https://saaa02.prod.com:8089</s:key>

                <s:key name="mgmt_uri_alias">https://172.25.4.201:8089</s:key>

                <s:key name="status">Up</s:key>

              </s:dict>

            </s:key>

          </s:dict>

 

I am  trying to match the two lines in bold using the following regex:

.*name\x3d\x22mgmt_uri_alias\x22>https:\x2f\x2f172\x2e25\x2e4\x2e201:8089<\x2fs:key>\n\s+<s:key\sname="status">Up<\/s:key>.*

 

This fails to match due to multi-line, the following regex matches:

.*name\x3d\x22mgmt_uri_alias\x22>https:\x2f\x2f172\x2e25\x2e4\x2e201:8089<\x2fs:key>.*

 

We’ve tried a number of combination to pass the multi-line issue:

\W+\s+

\r\n\s+

\n+\s+

.+?

 

Any suggestions? Running this on https://regex101.com works.

3 Replies

  • yuhuang based on a regex match tool the string you provided should absolutely match the text that you want to match. What is the failure reason when you apply the health monitor? You should be able to see the failure reason by going into the pool and then one of the failing pool members which should load a page to show why the health monitor is failing.

    • yuhuang's avatar
      yuhuang
      Icon for Nimbostratus rankNimbostratus

      Paulius,

      This configuration is in BIG IP DNS. I have applied the health check monitor at the Virtual Servers level, not the pool level. Under the virtual server properties page, I do not have any option to view the reason for the health check monitor failing.

       

      • Paulius's avatar
        Paulius
        Icon for MVP rankMVP

        yuhuang Sadly I don't remember the exact locations for BIG IP DNS and I do not have a lab device for it. I'm almost certain that they still tier out the same on that device so you should be able to look at the object associated to the WideIP and look in that object to see why the device is failing the health monitor. You could also have some odd white space or line space character in the returned text so you might consider saving the reply from the server to a file and then opening it in a coding application to see if you can see any special characters.