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"
if {$div1 == 0} {
pool pool_s1_6001
}
if {$div1 == 1} {
pool pool_s2_6001
}
}
But we has problem.
We've got errlr log when $index's result 08 or 09.
But 18, 19, 28, 29, 00, etc.. numbers are doesn't have problem.
Anyone know about this?
Oct 10 11:10:20 tmm tmm[728]: 01220001:3: TCL error: Rule rule_udp_6001_lb - expected integer but got "09" (looks like invalid octal number) while executing "expr (($index1)%2)"
Oct 10 11:10:20 tmm tmm[728]: 01220001:3: TCL error: Rule rule_udp_6001_lb - expected integer but got "09" (looks like invalid octal number) while executing "expr (($index1)%2)"
- Deb_Allen_18Historic F5 AccountFrom the format man page:
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 } }
- Deb_Allen_18Historic F5 Account(oops, had to clean that blockquote up a bit, see above for corrections)
- SC_Baek_82122
Nimbostratus
Wow!. It' works! Thanks a lot of your answer.Oct 11 12:15:18 tmm tmm[731]: Rule rule_udp_6001_lb_new : index_6001: 9 Oct 11 12:15:18 tmm tmm[731]: Rule rule_udp_6001_lb_new : div_6001: 1 Oct 11 12:15:18 tmm tmm[731]: Rule rule_udp_6001_lb_new : select pool S2_6001 Oct 11 12:15:18 tmm tmm[731]: 01220001:3: TCL error: Rule rule_udp_6001_lb_new - Address in use (line 11) invoked from within "pool pool_s2_6001" Oct 11 12:18:07 tmm tmm[731]: Rule rule_udp_6001_lb_new : index_6001: 8 Oct 11 12:18:07 tmm tmm[731]: Rule rule_udp_6001_lb_new : div_6001: 0 Oct 11 12:18:07 tmm tmm[731]: Rule rule_udp_6001_lb_new : select pool S1_6001 Oct 11 12:18:07 tmm tmm[731]: Rule rule_udp_6001_lb_new : index_6001: 8 Oct 11 12:18:07 tmm tmm[731]: Rule rule_udp_6001_lb_new : div_6001: 0 Oct 11 12:18:07 tmm tmm[731]: Rule rule_udp_6001_lb_new : select pool S1_6001 Oct 11 12:18:07 tmm tmm[731]: 01220001:3: TCL error: Rule rule_udp_6001_lb_new - Address in use (line 11) invoked from within "pool pool_s1_6001" Oct 11 12:18:07 tmm tmm[731]: Rule rule_udp_6001_lb_new : index_6001: 8 Oct 11 12:18:07 tmm tmm[731]: Rule rule_udp_6001_lb_new : div_6001: 0 Oct 11 12:18:07 tmm tmm[731]: Rule rule_udp_6001_lb_new : select pool S1_6001 Oct 11 12:18:07 tmm tmm[731]: 01220001:3: TCL error: Rule rule_udp_6001_lb_new - Address in use (line 14) invoked from within "pool pool_s1_6001" Oct 11 12:18:07 tmm tmm[731]: Rule rule_udp_6001_lb_new : index_6001: 8 Oct 11 12:18:07 tmm tmm[731]: Rule rule_udp_6001_lb_new : div_6001: 0 Oct 11 12:18:07 tmm tmm[731]: Rule rule_udp_6001_lb_new : select pool S1_6001 Oct 11 12:18:07 tmm tmm[731]: 01220001:3: TCL error: Rule rule_udp_6001_lb_new - Address in use (line 14) invoked from within "pool pool_s1_6001"
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 == 1} { log local0. "select pool S2_6001" pool pool_s2_6001 } else { log local0. "select pool S1_6001" pool pool_s1_6001 } }
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