流畅不将gelf格式的日志发送到graylog

时间:2019-10-15 07:22:42

标签: linux logging fluentd graylog3

我正在容器内流畅地运行,该容器已将某些日志作为卷安装,但不会将日志发送为graylog GELF udp格式。显示的消息

我尝试使用netcat将tcp消息发送到Graylog的原始纯文本输入,并且可以正常工作,但是当我尝试发送udp消息时,Graylog没有收到它。我也尝试将fluentd配置更改为发送tcp输入,但是也无法正常工作。我假设我在流畅的配置代码中缺少了一些东西

流利的conf文件

 <match graylog2.**>
      <store>
        @type gelf
        host 136.243.6.94
        port 12201
        flush_interval 5s
      </store>
    </match>

    ###
    # myapp logs
    ###
    <source>
      @type tail
      format json
      time_key time
      time_format %Y-%m-%dT%H:%M:%S.%LZ
      path /var/log/apps/pm2/log/server-out.log
      tag graylog2.server-out
      pos_file /var/log/fluentd/server-out.pos
    </source>

流利的消息传递容器


    2019-10-14 14:04:01 +0000 [info]: starting fluentd-1.3.2 pid=6 ruby="2.3.3"
    2019-10-14 14:04:01 +0000 [info]: spawn command to main:  cmdline=["/usr/bin/ruby2.3", "-Eascii-8bit:ascii-8bit", "/usr/local/bin/fluentd", "-c", "/fluentd/etc/fluent.conf", "-p", "/fluentd/plugins", "--under-supervisor"]
    2019-10-14 14:04:02 +0000 [info]: gem 'fluentd' version '1.3.2'
    2019-10-14 14:04:02 +0000 [info]: adding match in @mainstream pattern="docker.**" type="file"
    2019-10-14 14:04:02 +0000 [warn]: #0 [output_docker1] 'time_format' specified without 'time_key', will be ignored
    2019-10-14 14:04:02 +0000 [info]: adding match in @mainstream pattern="**" type="file"
    2019-10-14 14:04:02 +0000 [warn]: #0 [output1] 'time_format' specified without 'time_key', will be ignored
    2019-10-14 14:04:02 +0000 [info]: adding filter pattern="**" type="stdout"
    2019-10-14 14:04:02 +0000 [info]: adding source type="forward"
    2019-10-14 14:04:02 +0000 [info]: #0 starting fluentd worker pid=18 ppid=6 worker=0
    2019-10-14 14:04:02 +0000 [info]: #0 [input1] listening port port=24224 bind="0.0.0.0"
    2019-10-14 14:04:02 +0000 [info]: #0 fluentd worker is now running worker=0
    2019-10-14 14:04:02.500728737 +0000 fluent.info: {"worker":0,"message":"fluentd worker is now running worker=0"}
    2019-10-14 14:04:02 +0000 [warn]: #0 no patterns matched tag="fluent.info"

0 个答案:

没有答案