Forum Discussion
collinz1_17223
Nimbostratus
Jan 18, 2011iRule using findstr in TCP payload
I am trying to create an irule that will search the TCP response from a server for the userData: value and them persist based on that. The irule is below, which i have associated with a Universal persistence profile, but when i try to initiate a connection, no connection is being established to one of the load balanced servers. If i remove the persistence profile i am load balanced fine:
when SERVER_CONNECTED {
TCP::collect 1500
}
when SERVER_DATA {
set usrid [findstr [TCP::payload] "userData:" 9]
if {$usrid ne ""} {
persist uie $usrid
}
}
2 Replies
- hoolio
Cirrostratus
Are you sure the failure is that no serverside connection is attempted or established? The iRule shouldn't take any effect until then.
Can you add TCP::release to SERVER_DATA and retest?
http://devcentral.f5.com/wiki/default.aspx/iRules/tcp__release
Aaron - collinz1_17223
Nimbostratus
It appears that if i reduce the TCP::collect value, i get connected. However i only get connected if i set the value to 19 or below:TCP::collect 19
Which is fine as far as connecting goes, however i guess this means that the irule is only collecting 19 bytes of data, which isn't enough to find my search string.
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