Forum Discussion

Steve_Spencer_1's avatar
Steve_Spencer_1
Icon for Nimbostratus rankNimbostratus
Jul 19, 2005

logging... a question of timing

Hello all,

 

 

I'm pretty new to f5 and irules, but i've been asked to put together an irule which will put the client_ip server_ip target_url into the log file... Here's what i came up with:

 

 

when HTTP_REQUEST {

 

set the url here, log it on response...

 

set url [HTTP::header Host][HTTP::uri]

 

}

 

 

when HTTP_RESPONSE {

 

set client [IP::client_addr]

 

set server [IP::server_addr]

 

log local0. "$client $server https://$url"

 

}

 

 

It took me a little while to figure out how to get the ulr into the log, and i am curious as to whether this scheme is going to be accurate. For example, suppose you get an http request, and the $url variable gets set. Before the server can respond, another request comes in and $url gets set again. Finally a response to the first request is generated and info gets sent to the log... the question is: Will my log have:

 

client_ip server_ip first_url

 

or:

 

client_ip server_ip second_url

 

 

Of course, any help will be appreciated!

 

 

Thanks,

 

 

sspencer
  • rapmaster_c_127's avatar
    rapmaster_c_127
    Historic F5 Account
    Rule state is per connection, not global unless you explicitly declare a global variable. It'd be a horrible, horrible bug if it weren't!