Skip to content

Instantly share code, notes, and snippets.

@suzuki
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suzuki/ac991ced3139e109e5dd to your computer and use it in GitHub Desktop.
Save suzuki/ac991ced3139e109e5dd to your computer and use it in GitHub Desktop.
<source>
type tail
format /^(?<ip>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] (?<server>\S+) "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<status>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<user_agent>[^\"]*)")?$/
time_format %d/%b/%Y:%H:%M:%S %z
path /var/log/tdiary_access.log
pos_file /var/log/td-agent/tdiary_access.log.pos
tag tdiary.access
</source>
<match tdiary.access>
type elasticsearch
type_name access_log
host [解析サーバのIPアドレス]
port 9200
logstash_format true
include_tag_key true
tag_key @log_name
</match>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment