Logstash- getting specific lines

(Godson Raju) #1

I was wondering if I can get the 10 lines following the Keyword "Exception" in the message field of a Tomcat log file. I am able to get the lines with a specific keyword but failed to get the lines following the line with the keyword.

Thanks.

#2

You can maintain state in an aggregate filter. This post has an example of collecting data in the map and then generating an event when some condition is met.

It is not a scaleable solution and is really not a use case logstash was designed for.

1 Like