Forum Discussion
Karlsen_58024
Nimbostratus
Oct 03, 2012iRule hitcount logging
Hello DevCentral,
I have an iRule for redirection based on host headers. I want to make a hit count on each host header. Is this possible?
when HTTP_REQUEST {
if { [HTTP::hos...
nitass
Employee
Oct 03, 2012statistics profile
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
profiles {
http { }
mystats { }
tcp { }
}
rules {
myrule
}
snat automap
vlans-disabled
}
root@(ve11a)(cfg-sync Changes Pending)(Active)(/Common)(tmos) list ltm profile statistics mystats
ltm profile statistics mystats {
app-service none
field1 example.com
field2 example.no
field3 example.dk
}
root@(ve11a)(cfg-sync Changes Pending)(Active)(/Common)(tmos) list ltm rule myrule
ltm rule myrule {
when HTTP_REQUEST {
if { [HTTP::host] contains "example.com" } {
STATS::incr mystats example.com 1
HTTP::redirect "https://www.secureexample.com[HTTP::uri]"
}
if { [HTTP::host] contains "example.no" } {
STATS::incr mystats example.no 1
HTTP::redirect "https://www.secureexample.no[HTTP::uri]"
}
if { [HTTP::host] contains "example.dk" } {
STATS::incr mystats example.dk 1
HTTP::redirect "https://www.secureexample.dk[HTTP::uri]"
}
}
}
root@(ve11a)(cfg-sync Changes Pending)(Active)(/Common)(tmos) show ltm profile statistics mystats
--------------------------------
Ltm::Profile Statistics: mystats
--------------------------------
example.com 7
example.dk 1
example.no 4
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