Forum Discussion
SC_Baek_82122
Nimbostratus
Oct 10, 2007I don't know about iRule error message.
We make simple irule for 2 byte udp payload based LB.
when CLIENT_DATA {
set index1 [UDP::payload 2]
set div1 [expr (($index1)%2)]
log local0. "index_6001: $index1"
log local0. "div_6001: $div1"...
Deb_Allen_18
Oct 10, 2007Historic F5 Account
From the format man page:
i
Convert integer to signed decimal string; the integer may either be in decimal, in octal (with a leading 0) or in hexadecimal (with a leading 0x).Looks like the leading 0 indicates an octal value, and 8 & 9 are not legal octal digits.
I couldn't figure out a way to get format to solve this problem, but here's something that should work around the issue until a better solution is found:
when CLIENT_DATA {
if {[UDP::payload 2] < 10 }{
set index1 [substr [UDP::payload 2] 1 1]
} else {
set index1 [UDP::payload 2]
}
set div1 [expr {$index1%2}]
log local0. "index_6001: $index1"
log local0. "div_6001: $div1"
if {$div1 == 0} {
pool pool_s1_6001
} else {
pool pool_s2_6001
}
}HTH, and please post back (anybody!) if you find a cleaner solution.
/deb
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