-
-
Save imweijh/c427dd1f97a92b34e205e296d20585bf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
generator { | |
count => 1 | |
lines => [ | |
"qid=ABCD1 first", | |
"qid=XYZ2 first", | |
"qid=ABCD1 second", | |
"qid=XYZ2 second", | |
"qid=ZZZZ first", | |
"qid=ABCD1 third" | |
] | |
} | |
} | |
filter { | |
kv { } | |
multiline { | |
# Group by 'qid' | |
stream_identity => "%{qid}" | |
# Any lines | |
pattern => "" | |
what => next | |
} | |
} | |
output { | |
stdout { codec => json_lines } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% bin/logstash -f test.conf | |
{"message":"qid=ABCD1 first\nqid=ABCD1 second\nqid=ABCD1 third","@version":"1","@timestamp":"2015-01-19T20:01:21.386Z","host":"Macintosh.local","sequence":0,"qid":"ABCD1","tags":["multiline"]} | |
{"message":"qid=XYZ2 first\nqid=XYZ2 second","@version":"1","@timestamp":"2015-01-19T20:01:21.387Z","host":"Macintosh.local","sequence":0,"qid":"XYZ2","tags":["multiline"]} | |
{"message":"qid=ZZZZ first","@version":"1","@timestamp":"2015-01-19T20:01:21.392Z","host":"Macintosh.local","sequence":0,"qid":"ZZZZ","tags":["multiline"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment