Forum Discussion
Mike_73765
Nimbostratus
Jan 05, 2011Logging Certain number of characters with HTTP::request
Hello,
I am logging the following info:
log local0. "Client Address: [IP::client_addr], HTTP Header: [HTTP::request]"
A sample output from the HTTP::request command is:
Client Address: 192.168.1.15, HTTP Header: GET /site/shadowbox/play.png HTTP/1.1 Accept: */* Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET CLR 1.1.4322) Host: site.com Connection: Keep-Alive Cookie: UserAgentId=-1067132148225647718996; JSESSIONID=; site.server=webserver2; site.web.server=webserver2; runId=-6772998382442248823763483
I want to log only up until the point of the GET request. So the desired output would look like this:
Client Address: 192.168.1.15, HTTP Header: GET /site/shadowbox/play.png
How can I grab just the GET out of this header?
Thanks,
Mike
3 Replies
Sort By
- Mike_73765
Nimbostratus
sorry, titled the post wrong. cant use number of characters because that varies. i'd like to log up to HTTP/ - Colin_Walker_12Historic F5 AccountI think you can get what you're looking for by combining a few pre-built commands rather than doing some complicated scan or regular expression.
when HTTP_REQUEST { log local0. "Client Address:[IP::client_addr], Request Type:[HTTP::method], Request URI:[HTTP::uri]" }
- Mike_73765
Nimbostratus
Thanks Colin. HTTP::uri will work for me.
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