■ インストールスクリプトのダウンロード & 実行
■ サービス起動
[root@fluentd1 ~]# systemctl status td-agent
● td-agent.service - LSB: data collector for Treasure Data
Loaded: loaded (/etc/rc.d/init.d/td-agent; bad; vendor preset: disabled)
Active: inactive (dead)
Docs: man:systemd-sysv-generator(8)
[root@fluentd1 ~]# systemctl start td-agent
[root@fluentd1 ~]# systemctl status td-agent
● td-agent.service - LSB: data collector for Treasure Data
Loaded: loaded (/etc/rc.d/init.d/td-agent; bad; vendor preset: disabled)
Active: active (running) since 日 2019-03-03 14:59:46 JST; 7s ago
Docs: man:systemd-sysv-generator(8)
Process: 1492 ExecStart=/etc/rc.d/init.d/td-agent start (code=exited, status=0/SUCCESS)
Main PID: 1516 (ruby)
CGroup: /system.slice/td-agent.service
tq1516 /opt/td-agent/embedded/bin/ruby /usr/sbin/td-agent --log /var/log/td-agent/td-a...
mq1519 /opt/td-agent/embedded/bin/ruby /usr/sbin/td-agent --log /var/log/td-agent/td-a...
3月 03 14:59:45 fluentd1.oresamalabo.local systemd[1]: Starting LSB: data collector for Treas.....
3月 03 14:59:45 fluentd1.oresamalabo.local runuser[1509]: pam_unix(runuser:session): session o...)
3月 03 14:59:46 fluentd1.oresamalabo.local td-agent[1492]: [44B blob data]
3月 03 14:59:46 fluentd1.oresamalabo.local systemd[1]: Started LSB: data collector for Treasu...a.
Hint: Some lines were ellipsized, use -l to show in full.
■ 動作確認
[root@fluentd1 ~]# tail -3 /var/log/td-agent/td-agent.log
2019-03-03 14:59:46 +0900 [info]: listening fluent socket on 0.0.0.0:24224
2019-03-03 15:00:35 +0900 debug.test: {"json":"message"}
設定ファイルはここ。
* 設定ファイル -> /etc/td-agent/td-agent.conf
* ログファイル -> /var/log/td-agent/td-agent.log
参考
CentOS7でFluentdを使用してログ収集をしてみよう