LoginSignup
10
11

More than 5 years have passed since last update.

rsyslogで取得したログを直接fluentdに送る

Last updated at Posted at 2016-01-25

About

前々からやろうと思っていて、一念発起したのでやってみます。

rsyslogの送信テスト

$ sudo logger -p authpriv.1 "test"

-p : ファシリティ/プライオリティの指定

ファシリティ/プライオリティ

ざっくり言うとファシリティがログの単位、プライオリティがログレベル。

プライオリティは0 - 8?

0:emergency
1:arelt
2:critical
3:error
4:warning
5:notice
6:info
7:debug
以下以降繰り返し?
/etc/rsyslog.d/forwarder.conf
# /var/log/secure
authpriv.* @127.0.0.1:5140

@でホストを指定する。

td-agentの設定

<source>
  type syslog
  port 5140
  bind 127.0.0.1
  tag system.local
</source>

<match system.**>
  @type file
  path /var/log/test-syslog.log
  time_slice_format %Y%m%d
  time_slice_wait 1m
</match>

syslog用に開けた5140ポートに対してログを送信する

10
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
11