Matt_Williamson
Mar 29, 2005Nimbostratus
iRule to persist on tcp_content
Hi all, I'm trying to write a rule that will search the first 2500 bytes of tcp_content for the "USERNAME=" string and then persist on the next 7 characters after that. Here is my original attempt.
rule client_tcpusrid_persist {
when CLIENT_ACCEPTED {
set usrid {findstr [tcp_content(2500) contains "USERNAME="] "USERNAME=" 7 "t"}
if {tcp_content(2500) contains "USERNAME="} {
persist uie $usrid
log local0. "Persisting $userid"
}
}
}
Here's the error I'm getting...
01070151:3: Rule [getfield_test] error: line 1: [undefined procedure: rule] [rule client_tcpusrid_persist {
when CLIENT_ACCEPTED {
set usrid {findstr [tcp_content(2500) contains "USERNAME="] "USERNAME=" 7 "t"}
if {tcp_content(2500) contains "USERNAME="} {
persist uie $usrid
log local0. "Persisting $userid"
}
}
}]
Any help you can give would be great. Thanks.
Matt