Forum Discussion
kmtmt_51646
Nimbostratus
Oct 04, 2012Request URL matching by Data Group
Dear forum members,
It's my first time to play with Data Group. I created it from GUI like follows:
========
ltm data-group internal /Common/addresslist {
records {
address1 {
data www.abc.com
}
address2 {
data www.abcd.com
}
address3 {
data www.abcde.com
}
}
type string
}
========
and my iRule looks like this:
========
when HTTP_REQUEST {
if { [class match [HTTP::host] equals addresslist] }{
pool pool-1
return
}
}
========
I access to Virtual Server with hostname www.abc.com or www.abcd.com but it's not sent to the pool-1 at all.
pool-1 is accessble when I don't use this iRule, so the issue should be on the iRule or Data Group... Does anyone have a clue?
Thank you in advance,
- What_Lies_Bene1
Cirrostratus
Try this instead. I think 'equals' won't work because of the string name and value pairing;when HTTP_REQUEST { if { [class match [string tolower [HTTP::host] contains addresslist]] } { pool pool-1 return } }
- nitass
Employee
e.g.root@(ve11a)(cfg-sync Changes Pending)(Active)(/Common)(tmos) list ltm virtual bar ltm virtual bar { destination 172.28.19.252:80 ip-protocol tcp mask 255.255.255.255 pool foo profiles { http { } tcp { } } rules { myrule } snat automap vlans-disabled } root@(ve11a)(cfg-sync Changes Pending)(Active)(/Common)(tmos) list ltm data-group internal addresslist ltm data-group internal addresslist { records { www.abc.com { } www.abcd.com { } www.abcde.com { } } type string } root@(ve11a)(cfg-sync Changes Pending)(Active)(/Common)(tmos) list ltm rule myrule ltm rule myrule { when HTTP_REQUEST { set host [HTTP::host] if {[class match -- $host equals addresslist]} { pool pool-1 } } when SERVER_CONNECTED { log local0. "[IP::client_addr]:[TCP::client_port] | $host | [LB::server pool]" } } [root@ve11a:Active:Changes Pending] config tail -f /var/log/ltm Oct 4 21:58:35 tmm info tmm[9895]: Rule /Common/myrule : 172.28.19.251:36481 | www.abc.com | /Common/pool-1 Oct 4 21:58:52 tmm info tmm[9895]: Rule /Common/myrule : 172.28.19.251:36482 | www.other.com | /Common/foo Oct 4 21:58:57 tmm info tmm[9895]: Rule /Common/myrule : 172.28.19.251:36483 | www.abcd.com | /Common/pool-1 Oct 4 21:58:59 tmm info tmm[9895]: Rule /Common/myrule : 172.28.19.251:36484 | www.abcde.com | /Common/pool-1 Oct 4 21:59:03 tmm info tmm[9895]: Rule /Common/myrule : 172.28.19.251:36485 | www.xyz.com | /Common/foo
- kmtmt_51646
Nimbostratus
Hi What Lies Beneath san - kmtmt_51646
Nimbostratus
Hi nitass,
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