Created
August 3, 2015 10:29
-
-
Save igorwwwwwwwwwwwwwwwwwwww/bf46534dedc0b72ac663 to your computer and use it in GitHub Desktop.
This file contains 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
hello  {"foo":"bar"} |
This file contains 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
{ | |
"message" => "hello \\xC2 {\\\"foo\\\":\\\"bar\\\"}", | |
"@version" => "1", | |
"@timestamp" => "2015-08-03T10:26:07.100Z", | |
"host" => "igor-rg.local", | |
"jsoninsides" => "{ \\\"foo\\\":\\\"bar\\\" }" | |
} |
This file contains 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
hello {"foo":"bar"} |
This file contains 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
{ | |
"message" => "hello {\"foo\":\"bar\"}", | |
"@version" => "1", | |
"@timestamp" => "2015-08-03T10:26:20.266Z", | |
"host" => "igor-rg.local", | |
"jsoninsides" => "{ \"foo\":\"bar\" }" | |
} |
This file contains 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
cat broken.json | logstash -f testconf.conf --debug | |
cat fixed.json | logstash -f testconf.conf --debug |
This file contains 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 { | |
stdin { | |
} | |
} | |
filter{ | |
grok { | |
match => ["message", "^.*?\{%{GREEDYDATA:jsoninsides}\}"] | |
} | |
mutate { | |
replace => [ "jsoninsides", "{ %{jsoninsides} }" ] | |
} | |
} | |
output { | |
stdout { codec => rubydebug } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment