Skip to main content

Apache Access Logs

Log Type: Apache Access Logs

Template Description: Parsing the common fields in your Apache Access log.

Sample Log:

221.125.19.252 - - [2017-07-13 17:59:50.697 +0000] "GET /_js/master.js HTTP/1.1" 200 8825 "http://www.google.com/url?sa=t&rct=j...source=web&cd=4" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us) AppleWebKit/533.21.1 (KHTML, like Gecko) Chrome/19.0.1084.30 Safari/536.5"

Parsing Rule:

parse regex "^(?<src_ip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"
| parse regex "(?<method>[A-Z]+)\s(?<url>\S+)\sHTTP/[\d\.]+\"\s(?<status_code>\d+)\s(?<size>[\d-]+)\s\"(?<referrer>.*?)\"\s\"(?<user_agent>.+?)\".*"

Resulting Fields:

FieldDescriptionExample
src_ipIP address of the client (remote host) from which the request is made to the server.221.125.19.252
methodMethod used by the client.GET
urlResource requested by the client./_js/master.js
status_codeStatus code that the server sends back to the client.200
sizeSize of the object returned to the client.8825
referrerDisplays the site that the client reports having been referred from.http://www.google.com/url?sa=t&rct=j...source=web&cd=4
user_agentIdentifying information that the client browser reports about itself.Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us)
AppleWebKit/533.21.1 (KHTML, like Gecko)
Chrome/19.0.1084.30
Safari/536.5
Status
Legal
Privacy Statement
Terms of Use

Copyright © 2024 by Sumo Logic, Inc.