Forum Discussion
Techgeeeg_28888
Oct 15, 2014Nimbostratus
Logging the request coming to a Virtual Server
Hi Everyone,
I want to record each and every hit on my Virtual Server. It want the hit log to be sent to my Syslog server. I have configured the Syslog IP under the "Remote Logging" configuratio...
Kevin_Davies_40
Aug 16, 2016Nacreous
Since you went there... I wasnt going to as the built-in capability is easier to use and manage.
However if you are going to log from an iRule then you need a way to correlate the log information as their is multiple connections and many http requests. The prefix specified below allows you to correlate each tcp session and the http requests that belong to that session in the logs.
when CLIENT_ACCEPTED {
set hsl [HSL::open -proto UDP -pool syslog_server_pool]
set prefix "\[[IP::client_addr]:[TCP::remote_port]\]:"
HSL::send $hsl "<190> $prefix New Connection to [virtual]\n"
}
when HTTP_REQUEST {
set prefix "\[[IP::client_addr]:[TCP::remote_port]:[expr { rand() * 1000000 }]\]:"
HSL::send $hsl "<190> $prefix URL http(s)://[HTTP::host][HTTP::uri]"
}
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