Forum Discussion
Logging X-Forwarded ip address on ltm logs via irule.
Hi Jibinpv,
You have used HTTP:Header which should be HTTP::header. So please use [HTTP::header X-Forwarded-For]
Try this iRule to get all the HTTP request headers in /var/log/ltm
when HTTP_REQUEST
{
log local0. "============================================="
foreach arrayHeaders [HTTP::header names]
{
log local0. "$arrayHeaders: [HTTP::header value $arrayHeaders]"
}
log local0. "============================================="
}
- JibinpvJun 07, 2018
Nimbostratus
Hi Leoline,
Apologies ,that was a typo from me while copy pasted here. The actual config includes [HTTP::header X-Forwarded-For]. Also I have tried the suggest irule too which given me a TCL error.
TCL error: - can't read "arrayHeaders": no such variable while executing "log local0. "$arrayHeaders: [HTTP::header value $arrayHeaders]
- leonline_225556Jun 07, 2018
Altostratus
Hi Jibinpv,
Which version are you running? Are you using a standard vs with http profile enabled?
- Sunny_291145Jun 07, 2018
Nimbostratus
You can replace arrayHeaders with aHeader
Which looks like
when HTTP_REQUEST { log local0. "=============================================" foreach aHeader [HTTP::header names] { log local0. "$aHeader: [HTTP::header value $aHeader]" } log local0. "=============================================" }
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