我认为在Filebeat中进行多行处理是解决问题的方法,因此与其调试您发布的Logstash配置错误,不如我展示一个Filebeat配置,其中Filebeat在发送事件之前将这些行合并在一起。
如果仅将Logstash用于多行过滤器,则可以直接从Filebeat输出到Elasticsearch。但是,如果确实需要输出到Logstash,请按照说明配置与Logstash一起使用的Filebeat。
我在下面使用的模式尚未经过全面测试,因此请对照实际日志进行测试。
filebeat.prospectors:- document_type: catalina-wine-mixer paths: - /opt/tomcat-test/logs/catalina.out multiline.pattern: '^([0-9]{4}-[0-9]{2}-[0-9]{2})|([J|F|M|A|M|S|O|N|D][a-z]{2} [0-9]{1,2}, [0-9]{2})' multiline.negate: true multiline.match: afteroutput.elasticsearch: hosts: ['http://localhost:9200']


