Forum Discussion
HSL -logging various HTTP::Header values
Hi, i am trying to capture the "X-Forwarded-For" and other header info in this High Speed Logging iRule but not sure if it's going to work.
when CLIENT_ACCEPTED {
set hsl [HSL::open -proto UDP -pool syslog_server_pool] }
when HTTP_REQUEST {
if { [HTTP::header exists "Content-Length"]} {
HSL::send $hsl "<190> Virtual: [virtual name], IP: [IP::client_addr], Method: [HTTP::method], XFF: [HTTP::header X-Forwarded-For], Content-Type: [HTTP::header Content-Type], Content-length: [HTTP::header Content-Length] for [HTTP::uri]"
}
}
thanks!
4 Replies
- What_Lies_Bene1
Cirrostratus
Based on what I can find on the iRules wiki, it looks good, although you may want a \n at the end of your text. - JP_42120
Nimbostratus
Thanks WLB! - What_Lies_Bene1
Cirrostratus
You're welcome. Has it worked then? - hoolio
Cirrostratus
You could also use [HTTP::header values X-Forwarded-For] in case there are multiple XFF headers in the request.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
