Forum Discussion

Vladimir_Akhmarov's avatar
Dec 08, 2022

No matches under XML_CONTENT_BASED_ROUTING

Hello!

 

I have a requirement to match and log selected XML content under APM enabled VS

I tried to follow https://techdocs.f5.com/en-us/bigip-15-0-0/big-ip-local-traffic-manager-implementations/routing-based-on-xml-content.html#GUID-CB96E40C-6AA4-4B0F-A8A4-3A131BC10BB1

Here is a XML:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
    <soap:Header>
        <t:RequestServerVersion Version="Exchange2007_SP1"/>
    </soap:Header>
    <soap:Body>
        <m:GetFolder xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
            <m:FolderShape>
                <t:BaseShape>IdOnly</t:BaseShape>
            </m:FolderShape>
            <m:FolderIds>
                <t:DistinguishedFolderId Id="root"></t:DistinguishedFolderId>
            </m:FolderIds>
        </m:GetFolder>
    </soap:Body>
</soap:Envelope>

 

Here is a XML profile:

ltm profile xml /Common/EWS_xml {
    app-service none
    defaults-from xml
    namespace-mappings {
        {
            mapping-namespace http://schemas.microsoft.com/exchange/services/2006/messages
            mapping-prefix m
        }
    }
    xpath-queries { //m:getfolder/* }
}

 

Here is an iRule:

when XML_CONTENT_BASED_ROUTING priority 500 { 
    for {set i 0} { $i < $XML_count } {incr i} {
        if {$static::iteco_exch_debug == 1} {
            log local1.debug "APM: 0149FFFF:F: [ACCESS::session data get "session.user.sessionid"]: $XML_queries($i) = $XML_values($i)"
        }
    }
}

 

Unfortunately I miss something and there are no logs nor iRule event XML_CONTENT_BASED_ROUTING matches

 

Can you help me to understand what is wrong in my configuration?

  • Kai_Wilke's avatar
    Kai_Wilke
    Dec 08, 2022

    Hi akhmarov,

    just wanted to get sure... 😉

    Try to format your xpath-query case-sensitive... 😉

     

    //m:GetFolder/*

     

    Cheers, Kai

  • Hi akhmarov,

    I'm afraid to ask, but did you assigned the XML profile to your Virtual Server?

    Cheers, Kai

    • Yes, of course 🙂

      ltm virtual /Common/EWS_vs {
          profiles {
              ...
              /Common/EWS_xml {
                  context all
              }
              ...
          }
      }

       

      • Kai_Wilke's avatar
        Kai_Wilke
        Icon for MVP rankMVP

        Hi akhmarov,

        just wanted to get sure... 😉

        Try to format your xpath-query case-sensitive... 😉

         

        //m:GetFolder/*

         

        Cheers, Kai