【发布时间】:2019-04-27 14:05:42
【问题描述】:
我正在尝试根据进程 ID 聚合事件。进程 ID 不是按顺序排列的,并且跨越多行。下面是一个这样的示例 -
2019 Apr 23 14:01:44:870 GMT +0000 BW.EnterpriseFlifoFormatter-EnterpriseFlifoFormatter USER [BW-User] - Interface Name : EFF: Process ID :674526635 Main Process has started^M
2019 Apr 23 14:01:44:870 GMT +0000 BW.EnterpriseFlifoFormatter-EnterpriseFlifoFormatter USER [BW-User] - Interface Name : EFF: Process ID :674526636 Main Process has started^M
2019 Apr 23 14:01:44:878 GMT +0000 BW.EnterpriseFlifoFormatter-EnterpriseFlifoFormatter USER [BW-User] - Interface Name : EFF: Process ID :674526636 Ending ODS query Process to create enterprise message^M
2019 Apr 23 14:01:44:882 GMT +0000 BW.EnterpriseFlifoFormatter-EnterpriseFlifoFormatter USER [BW-User] - Interface Name : EFF: Process ID :674526635 Send Message Process has finished at : 1556028104882 for flight 1206 departing on 2019-04-24 from EWR to CLT of type Leg Level Message^M
2019 Apr 23 14:01:44:882 GMT +0000 BW.EnterpriseFlifoFormatter-EnterpriseFlifoFormatter USER [BW-User] - Interface Name : EFF: Process ID :674526635 Send Message Process has finished at : 1556028104882 for flight 1206 departing on 2019-04-24 from EWR to CLT of type Flight Level Message^M
2019 Apr 23 14:01:44:882 GMT +0000 BW.EnterpriseFlifoFormatter-EnterpriseFlifoFormatter USER [BW-User] - Interface Name : EFF: Process ID :674526636 Send Message Process has begun at : 1556028104882 for flight 1196 departing on 2019-04-24 from CUN to ORD of type Leg Level Message^M
2019 Apr 23 14:01:44:883 GMT +0000 BW.EnterpriseFlifoFormatter-EnterpriseFlifoFormatter USER [BW-User] - Interface Name : EFF: Process ID :674526636 Send Message Process has begun at : 1556028104882 for flight 1196 departing on 2019-04-24 from CUN to ORD of type Flight Level Message^M
2019 Apr 23 14:01:44:882 GMT +0000 BW.EnterpriseFlifoFormatter-EnterpriseFlifoFormatter USER [BW-User] - Interface Name : EFF: Process ID :674526635 Main Process is ending for flight 1206 departing on 2019-04-24^M
2019 Apr 23 14:01:44:882 GMT +0000 BW.EnterpriseFlifoFormatter-EnterpriseFlifoFormatter USER [BW-User] - Interface Name : EFF: Process ID :674526636 Main Process is ending for flight 1206 departing on 2019-04-24^M
所以进程ID不是按顺序排列的,我们如何使用logstash聚合过滤器将属于同一进程ID的所有消息关联并作为单个事件发送
【问题讨论】:
-
感谢您的提问,我发现了这个插件elastic.co/guide/en/logstash/current/… 它应该适合您!我在下面留下我的答案并进行编辑。