Forum Discussion
HTTP XML irule based on string
Hi Team,
I need to write a irule for HTTP POST request with XML if matches string in between UE; the middle 2 characters direct traffic to pool1 or else pool2. Kindly suggest.
Thanks, Biswajeet
4 Replies
Hi Biswajeet,
Please be more specific with your question.
If possible capture your HTTP-POST request with a HTTP-Analyser and copy the entire request into your question (masking / removing sensitive parts of the request is fine)...
Cheers, Kai
- Biswajeet_38744
Nimbostratus
Hi Kai,
Thanks for a quick response. I need to cater traffic based on this String to respective pools in XML body: It will be always 2 characters. If matches send to pool1 else pool2.
UEHope this clarifies. Appreciate your suggestions.
Cheers, Biswajeet
- youssef1
Cumulonimbus
Hi,
Can you try this simple Irule. We can add more info after testing (mimetype...)
when HTTP_REQUEST { set capture 0 if { [HTTP::header exists Content-length] and ( [HTTP::method] equals "POST" } set capture 1 HTTP::collect [HTTP::header Content-Length] } } when HTTP_REQUEST_DATA { if {$capture} { if { [HTTP::payload] contains "UE<\/circle>" } { log local0. "Logs: trigged wanted post" } } } - Biswajeet_38744
Nimbostratus
Hi Kai,
Thanks for your help. The pools will be defined based on below characters in-between string .
UE middle characters PB,JK,UW,HP,RJ,DL,HR,MU,UE,MP,GJ,MHthen select pool1 or else pool2
My question here is how to match these many strings and select pool.
Thanks, Biswajeet
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com