Forum Discussion
spalande
Nacreous
Feb 17, 2014iRule for logging x-forwarded-for header
Getting client request with x-forwarded-for header value. How to log these using irule and using data group for specific client ips
3 Replies
- Arie
Altostratus
Where do you want to log the values? What are the specifics regarding client IP-addresses? - spalande
Nacreous
want to log the values in ltm logs. - Kevin_Stewart
Employee
The simplest approach might be something like this:
when HTTP_REQUEST { if { [HTTP::header exists X-Forwarded-For] } { log local0. "Received XFF from [IP::client_addr]: [HTTP::header X-Forwarded-For]" if { [class match [HTTP::header X-Forwarded-For] equals my_ip_dg] } { log local0. "Data group source match" } } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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