Skip to content

Instantly share code, notes, and snippets.

@takaheraw
Created July 17, 2018 08:18
Show Gist options
  • Save takaheraw/e7e23c1f32ca69338c6a64eef5878e33 to your computer and use it in GitHub Desktop.
Save takaheraw/e7e23c1f32ca69338c6a64eef5878e33 to your computer and use it in GitHub Desktop.
agent.conf
<system>
process_name fluentd
</system>
<source>
@id input_forward
@type forward
port 24224
</source>
<source>
@type ping_message
tag "ping.#{Socket.gethostname}"
data ${hostname}
interval 60
</source>
<source>
@id in_tail_club_access
# plugin
@type tail
# ログフォーマット
format ltsv
# 読み込むファイル
path /var/log/nginx/access.log
# 読み込んだファイルのoffset
pos_file /var/log/td-agent/in_tail_club_access.pos
# @label @club_access
# ルーティングを行う際の識別
tag club.access
# ローテート検出時に新しいファイルの先頭から読み込む設定(デフォルト:false)
read_from_head true
# 1時間(3600秒)以内に更新されたログファイルのみ監視対象とする(デフォルト:なし)
# read_from_head true のときに、対象パスに古いファイルが増えても無視するための設定
limit_recently_modified 3600
# ローテート検出時に、前のファイルへの書き込みを監視する秒数
rotate_wait 60
# 1行の長さが長く、Outputプラグイン側のバッファ少ないときに調整する
read_lines_limit 1000
# ログの日付情報が格納されるキーを指定(デフォルト:time)
time_key time
# timeキーの時刻をパースするためのフォーマットを指定(デフォルト:なし)
# time_format %Y-%m-%dT%H:%M:%S%z
time_format %d/%b/%Y:%H:%M:%S %z
# timeキーを残すかどうかの設定(デフォルト:false)
keep_time_key true
# ファイル更新検知のために1秒ごとのタイマーを使うか設定(デフォルト:false)
enable_watch_timer false
# パーミッションが無く読み取れなかったときのエラー出力を1回にする(デフォルト:false)
ignore_repeated_permission_error true
# ログレベル(デフォルト:info)
log_level info
</source>
<match {club.access,ping.**} >
@type forward
# ログ欠損を防ぐための設定
require_ack_response
<server>
host 10.0.2.10
</server>
</match>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment