Sathishkumar123
Oct 15, 2017Nimbostratus
Filter TCP payload in iRule
I am new to iRule and able to write small conditional statements. I have a simple iRule as below
when CLIENT_ACCEPTED {TCP :: collect}
when CLIENT_DATA { if { [TCP::payload] contains "SomeName/SomeServiceNameHere/"}
{ pool APoolUsedByMyApplication }
I know that my expected data SomeName/SomeServiceNameHere will be in first 500 bytes of my payload. Is it possible to selectively check the TCP payload? Say I would like to check from first 200 bytes to 600 bytes?
The rationale behind this is to avoid time taken for complete searching of TCP payload. I believe - if I am predictable about the string value which I am expecting is within particular range of TCP payload - there will be performance benefit.
Thanks for help in advance.