Hi
I have a JSON file as shown below. I want to read this file using logstash. Each log file i receive has only 1 JSON structure as shown below and nothing new gets appended to the log file. How can i combine these multiple lines in a single line to be parsed using JSON plugin in logstash?
{
"Stage1":
{
"Level1":
{
"field1": "True",
"field2": "True",
"field3": "True"
}
},
"Stage2":
{
"decimal":
{
"field3": "0",
"field4": "abc",
"field5": "True"
}
}
}
Below is a copy of my logstash config file
input
{
file
{
codec => multiline
{
pattern => '^}'
negate => true
what => next
}
path => ["/mnt/nfs/qa/JSONS/*.json"]
start_position => "beginning"
sincedb_path => "/dev/null"
}
}filter
{
mutate
{
gsub => [ 'message','\n','']
gsub => [ 'message','\s','']
replace => [ "message", "%{message}" ]
}}
output
{
stdout {}
}