Filebeat 多行合并

今天在一个坑里待了2个小时,明明配置是对的,但就是没有起效。

当前aaa.log日志为:

2017-02-14 11:52:18.772 [catalina-exec-74] DEBUG aaa - loginRespons:{
        "status": "200",
        "userId": "Pl016",
        "userGroup": "0",
        "areaCode": "9999",
        "epgIndexType": "",
        "epgIndex": "http://ip:58082/epg/api/page/biz_123456.json",
        "testEpgIndex":"http://ip:58082/epg/api/page/biz_123456.json",
        "epgServer": "http://ip:58082/epg/",
        "aaaServer": "http://ip:58082/epg/",
        userServer": "http://ip:58082/epg/",
}

日志到Logstash->elasticsearch->kibana中显示成N个message,如"status": "200"为一行, "userId": "Pl016"为另外一行。

参考filebeat的官网,在filebeat.yml中设置

filebeat.prospectors: 
- input_type: log
  document_type: aaa
  paths:
     - /opt/product/data/logs/epg/aaa*.*
  multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}'
  multiline.negate: true
  multiline.match: after
  multiline.timeout: 10s

重启容器,按道理是可以将非日期开头的的行 合并到第一行中的。
但是就是不生效。试了很多次,改配置,依旧没效果。

问题就出在:重启容器。
我以为docker-compose up -d 可以重启容器,但是事实并没有来着,
该命令对应含义:构建,(重新)创建,启动,链接一个服务相关的容器。

最后,真的重启容器后,问题就解决啦。
Paste_Image.png

亏呀,浪费了大好时光。

学习要保持一颗严谨的心。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容