Forum Discussion
DFeike_160744
Nimbostratus
Jul 09, 2015iRule to check for strings in xml
Hi guys,
i am currently struggling to build the correct syntax to do the following. I have http requests which contain a good amount of XML. Here is an extract from a pcap.
---snip
POST /TestSe...
Kevin_Stewart
Employee
Jul 09, 2015Well technically you're code might look something like this:
when HTTP_REQUEST {
if { [HTTP::header exists Content-length] }
HTTP::collect [HTTP::header Content-Length]
} else {
drop
}
}
when HTTP_REQUEST_DATA {
if { ( [HTTP::payload] contains "MessageID" ) and ( [HTTP::payload] contains "MachineName" ) } {
good request
} else {
drop
}
}The above should very specifically limit access to only requests that have a Content-Length header and contain these two values in the payload. But...
The example request you give is part of a 100-continue, which usually implies another request is coming with the rest of the payload. Are you certain, from captures, that every request has these two values? Will these values be in the very first requests?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects
