使用grok的Logstash过滤器



我是ELK堆栈的新手。目前我有以下日志-

Transaction1 start
component test1 5s
component test2 10s
component test3 15s
Transaction1 ended with total time 30s
Transaction2 start
component test4 15s
component test5 20s
component test6 15s
Transaction2 ended with total time 50s

我想索引各个组件及其时间和Transactionid以及提到的总时间
ex-对于Transaction1,单独的组件是test1、test2和test3。使用GROK将日志划分为令牌。但是,如何实现基于transactionid的聚合呢?如何使用logstash实现这一点。感谢

除非您可以按照建议重写日志,否则您应该检查多行输入编解码器,它将允许您将行组合为一条消息以用于logstash。然后,你就可以在这条线上摸索,提取你想要的东西。

最新更新