Forum Discussion
GVR_Dinesh_1748
Nimbostratus
Jun 01, 2018Solution to capture traffic logs for specific VIP in LTM
Traffic logs wont store in F5 LTM so is there anyway to store the traffic logs from clients to specific VIP in syslog server in network. Please answer if there is any solution.
youssef1
Cumulonimbus
Jun 04, 2018Hi,
you can try this irule:
when HTTP_REQUEST {
set capture 0
if {[IP::addr [IP::local_addr] equals 1.1.1.195] } {
set expert 1
set LogString "Client [IP::client_addr]:[TCP::client_port] -> [HTTP::host][HTTP::uri]"
log local0. "============================================="
log local0. "$LogString (request)"
foreach aHeader [HTTP::header names] {
log local0. "$aHeader: [HTTP::header value $aHeader]"
}
log local0. "============================================="
}
}
when HTTP_RESPONSE {
if {$xpert} {
log local0. "============================================="
log local0. "$LogString (response) - status: [HTTP::status]"
foreach aHeader [HTTP::header names] {
log local0. "$aHeader: [HTTP::header value $aHeader]"
}
log local0. "============================================="
}
}
If you want to store this logs you can use HSL in order to send it directly to your remote syslog.
You have an example of output logs here: https://devcentral.f5.com/codeshare/log-http-headers
Keep me in touch.
regards
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
