简体   繁体   中英

Logstash filter using grok

I am new to ELK stack. Currently i have following logs-

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

I want to index the individual components along with their time and Transactionid along with the mentioned total time.
ex- For Transaction1 the individual components are test1,test2 and test3. Using GROK will divide the logs into tokens. But how can the aggregation based on transactionid be achieved? How can this be achieved using logstash. Thanks

Unless you can rewrite the logs as has been suggested, you should check out the multiline input codec , which will allow you to combine the lines into one message for logstash. You would then be able to grok across that line to extract what you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM