I've appended a unique id to the very end of every log line that tags a log message as being part of a single http request. Generally an http request has 5 log lines in my application and if there are multiple users, the lines are not necessarily in order. Here's a contrived example
1 INFO 123.123.123.123 GET /search? params='foo' unique_id=12345ABCDE
2 INFO 111.111.111.111 POST /submit? params='bar' unique_id=ZZZZ8888
3 INFO 123.123.123.123 Completed 200 34ms unique_id=12345ABCDE
My goal is to combine lines 1 and 3 into the same elasticsearch document by matching on the unique_id. Is there a good solution for this with logstash? Thanks!
There are 2 main problems, first, I'm not seeing the aggregated records in elasticsearch. That is, there's no single record that contains the contents of the 3 aggregations.
The 2nd, is that I'm getting a ton of extra documents being stored with messages that are and empty string. I suspect that groking 3x on message is messing things up.
I would appreciate any advice. Thanks! [edit: apologizes for code formatting, it's hard to do in a browser]
When you specify message multiple times like that it'll try to match all 3.
What' you're supposed to do when groking for that is match the entire line, not just part of it.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.