Forum Discussion
Bruce_Hampton_1
Jun 27, 2012Nimbostratus
Logging HTTP::request pre and post HTTP profile
I thought this was simple, but I don't have it working just yet.
I need to log to the local0. the HTTP request as it was received by the LTM, and ALSO as it is being sent out on the server s...
nitass
Jun 27, 2012Employee
Aaron, clientside {} does not work to me. i still got command is not valid in current event context (HTTP_REQUEST_SEND).
bhampton, i think pre/post is not different since both log commands are done in HTTP_REQUEST.
this is an example vip targeting vip. not sure if there is another way to achieve what you want.
[root@ve1024:Active] config b virtual bar list
virtual bar {
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve1024:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
log local0. [HTTP::request]
HTTP::uri "/test"
virtual bar2
}
}
[root@ve1024:Active] config b virtual bar2 list
virtual bar2 {
snat automap
pool foo
destination 1.1.1.1:80
ip protocol 6
rules myrule2
profiles {
http {}
tcp {}
}
}
[root@ve1024:Active] config b rule myrule2 list
rule myrule2 {
when HTTP_REQUEST {
log local0. [HTTP::request]
}
}
[root@ve1024:Active] config curl -I http://172.28.19.79/something
HTTP/1.1 404 Not Found
Date: Wed, 27 Jun 2012 17:38:40 GMT
Server: Apache/2.2.3 (CentOS)
Content-Type: text/html; charset=iso-8859-1
[root@ve1024:Active] config
/var/log/ltm
Jun 27 10:38:29 local/tmm info tmm[4861]: Rule myrule : HEAD /something HTTP/1.1 User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Host: 172.28.19.79 Accept: */*
Jun 27 10:38:29 local/tmm info tmm[4861]: Rule myrule2 : HEAD /test HTTP/1.1 User-Agent: curl/7.15.5 (i686-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Host: 172.28.19.79 Accept: */*
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