Forum Discussion
Marissa_Kato_10
Nimbostratus
Jul 14, 2006irule that logs source IP address on BigIp OR server
I have found a solution(see below) on the askf5.com page that gives me the syntax for this request (i.e. SOL2530; however, I am fairly new at coding and am not sure what variables I need to input( for example what would I enter for "bgz").
OR, is it possible to record the actual source ip addresses on the server logs instead of the server logging the BigIP address, and if so, how would I code the irule for that? And would it consume an excess amount of resource on the BigIP?
In advance, any help would be greatly appreciated.
Thanks,
Rule given to log on the BigIP-SOL2530:
rule log_me {
if (http_uri matches_regex "bgz") {
log "client " + client_addr + ":" + client_port
use pool web
}
else {
log "client " + client_addr + ":" + client_port
use pool web
}
}
The output string for this sample rule will appear in the /var/log/bigip file as follows:
May 2 11:39:33 bigip1 kernel: RULE log_me - client 192.168.21.48:1431
Logging rule syntax from prior versions of BIG-IP still functions the same in BIG-IP version 4.5 PTF-04 and later, as long as the total character length is less than 64 characters.
- dennypayne
Employee
You don't necessarily need a rule to do what you are requesting...I'm assuming from your description that there is a SNAT enabled on BIG-IP that is changing the client source IP (this is required if BIG-IP is not the default gateway of the servers).
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