Karlsen_58024
Oct 03, 2012Nimbostratus
iRule 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::host] contains "example.com," } {
HTTP::redirect "https://www,.secureexample.com[HTTP::uri]"
}
if { [HTTP::host] contains "example.no" } {
HTTP::redirect "https://www.secureexample.no[HTTP::uri]"
}
if { [HTTP::host] contains "example.dk" } {
HTTP::redirect "https://www.secureexample.dk[HTTP::uri]"
}
}
I was thinking that I could use something like:
log local0. "Number of hits on [HTTP::host]:[HTTP::request_num]".
Any ideas on how I could implement it? All I want to know is how many hits each host header gets.
Regards,
Martin Karlsen