0

我们有一个应用程序,event log我们的应用程序发送event logKafkaJSON format我们topic在 Kafkahas one partition因为我们需要阅读order message,我们也Logstash用于消费event log并将格式转换JSONGELF格式然后发送到Graylog. 我们的问题是考虑到主题有分区,但是消费者(Logstash)没有按顺序阅读消息,我们的顺序被打乱了。我们用

 stdout{ codec => rubydebug }

在输出Logstash配置中,此Logstash日志确认了问题,自然,我们在 GaryLag 中没有按顺序排列的事件。为什么顺序混乱。卡夫卡或LogstashGraylog或...的问题?

谢谢。

更新

日志存储配置:

input {
  kafka {
        bootstrap_servers => "kafka1:9092,kafka2:9092,kafka3:9092"
        group_id => "MyTopicReader"
        topics => "MyTopic"
        consumer_threads => 1
        enable_metric => "false"
        auto_offset_reset => "latest"
 }
}

filter {
   json {
     source => "message"
  }
}

output {
      gelf {

           host => "ip-graylog"
           port => 12201
           sender => "ip-logstash"

    }
 stdout{ codec => rubydebug }
}

管道配置pipelines.yml

- pipeline.id: main
  path.config: "/etc/logstash/conf.d/*.conf"

管道设置logstash.yml

pipeline.id: main
pipeline.workers: 2
pipeline.batch.size: 125
pipeline.batch.delay: 50
4

1 回答 1

1

启动 Logstash-w 1以运行单个管道工作程序。

于 2020-04-13T13:26:53.167 回答