Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<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