Skip to content

Instantly share code, notes, and snippets.

@oranie
Created February 23, 2012 05:56
Show Gist options
  • Save oranie/1890810 to your computer and use it in GitHub Desktop.
Save oranie/1890810 to your computer and use it in GitHub Desktop.
td-agent.conf
<source>
type tcp
</source>
#<match apache.access>
# type file
# path /var/log/td-agent/access_log
#</match>
#<match apache.error>
# type file
# path /var/log/td-agent/error_log
#</match>
<match apache.*>
type datacounter
unit minute
count_key status
tag result
# patternX: X(1-9)
pattern1 2xx ^2\d\d$
pattern2 3xx ^3\d\d$
pattern3 404 ^404$ # we want only 404 counts...
pattern4 4xx ^4\d\d$ # pattern4 doesn't matches messages matches pattern[123]
pattern5 5xx ^5\d\d$
</match>
<match result>
type file
path /var/log/td-agent/counter.log
</match>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment