Skip to content

Instantly share code, notes, and snippets.

@asigatchov
Created December 28, 2016 19:04
Show Gist options
  • Save asigatchov/3679377b6c8cda543f7beed6a9755e9f to your computer and use it in GitHub Desktop.
Save asigatchov/3679377b6c8cda543f7beed6a9755e9f to your computer and use it in GitHub Desktop.
fluentd source
<source>
@type tail
format /(?<schema>https?)://(?<domain>[^ ]*) (?<remote>[^ ]*) (?<host>[^ ]*) (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)") (?<message>.*) (?<resptime>\d+\.\d+)$/
time_format %d/%b/%Y:%H:%M:%S %z
types remote:string,host:string,user:string,time:time,method:string,path:string,code:integer,referer:string,agent:string,message:string,size:integer,resptime:float
path /data/access.log
pos_file /tmp/access_tail_pos.log
tag es.demo.access
read_lines_limit 1000
</source>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment