Skip to content

Instantly share code, notes, and snippets.

@rhoboro
Last active September 6, 2015 04:18
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 rhoboro/c8f54f1ee757502e2cfb to your computer and use it in GitHub Desktop.
Save rhoboro/c8f54f1ee757502e2cfb to your computer and use it in GitHub Desktop.
<source>
type forward
port 24224
</source>
<match *.*>
type stdout // /var/log/td-agent/td-agent.logに追記されていく
</match>
<source>
type tail
path /var/log/messages
pos_file /var/log/td-agent/tmp/syslog.log.pos // どこまで読み込んだかを保存しておくファイル
tag syslog.messages // tailで引っかかったログにつけるタグ
format syslog
</source>
<source>
type tail
path /var/log/nginx/access.log
pos_file /var/log/td-agent/tmp/nginx.log.pos
tag nginx.access
format nginx // 一応ログは送信できてるけど、invalid time formatエラーになる。
</source>
<source>
type tail
path /var/log/nginx/error.log
pos_file /var/log/td-agent/tmp/nginx.log.pos
tag nginx.error
format /^(?<time>[^ ]+ [^ ]+) \[(?<log_level>.*)\] (?<pid>\d*).(?<tid>[^:]*): (?<message>.*)$/
</source>
<match *.*>
type forward
<server>
host 192.168.0.1
port 24224
</server>
</match>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment