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
Magnum_IP
Nimbostratus
Feb 18, 2014F5 Rocks,
Your request isn't 100% clear but here is something to get started...
Logging
To log out the X-Forwarded-For header
log local0. "X-Forwarded-For: [HTTP::header X-Forwarded-For]"
Data Group of IPs
Create a Data Group of type Address (for this example called client_ip_class) and add the IP addresses of interest. Use something like the following to check if an address exists in the Data Group
if { [class match [IP::client_addr] equals client_ip_class] } {
The client IP address is in the class file client_ip_class
Do something here...
}
Hope this helps.
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