熟练地将journalctl命令推送到弹性搜索

时间:2019-05-30 13:14:37

标签: fluentd td-agent

我正在使用td-agent将日志从influxdb推送到弹性搜索。     我遇到一个问题,当我在源代码中使用journalctl命令给exec时,无法获得相同的任何日志。     如何将日志从journalctl -f -u "myservice"转发到弹性服务器?

<source>
  @type exec
  <parse>
    @type json
  </parse>
  command sh /etc/td-agent/checkjournal.sh
  tag influx
</source>

<match influx.**>
  @type copy
  <store>
    @type stdout
  </store>
  <store>
    @type forward
    <server>
      name elk-server
      host 192.168.30.3
      port 10515
    </server>
  </store>
</match>

Checkjournal.sh包含以下代码:

exec journalctl --since=now  -f -u  influxdb

0 个答案:

没有答案
相关问题