Forum Discussion
rahtoll_74678
Sep 08, 2012Nimbostratus
Check for String in TCP Payload from a specific position
Hi Guys,
I’m new here, as well as with F5 systems. Though basic load balancing is okay, I have this requirement where I believe iRules would be of big help. From the TCP payload, ...
hooleylist
Sep 11, 2012Cirrostratus
That's a novel idea Michael, but I think it would have an unintended consequence of passing some of the data through on the serverside before parsing the full request payload.
Here's a sample for using binary scan I tried in a quick test. Maybe something like this will work for you?
when RULE_INIT {
Encode the raw bytes in base64 to test
set bytes_b64 "ABUXSF38AFBWnw8rCABFAAEqWx5AAIAGwrEKCAYS0OD7AydhEq69hQW7P+haN1AY+jbz+AAAAQAxNDEwMDAwMDAwMDAwMDE4ODg4ODgwMDU="
log local0. "\$bytes_b64: $bytes_b64"
set bytes_raw [b64decode $bytes_b64]
log local0. "\$bytes_raw: $bytes_raw"
Skip 59 bytes into the payload and save the next 6 bytes to $match
binary scan $bytes_raw x59a6 match
log local0. "\$match: $match"
}
< RULE_INIT >: $match: 000000
I'll reply with a more specific example in a minute.
Aaron
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