Marissa_Kato_10
Jul 14, 2006Nimbostratus
irule 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.