We are having sample json logs as below
{
"responseBody": {
"Info": [ {
"supplierBookReferences": [ {
"field1": "NA",
"field2": "NA",
"field3": "",
"field4": "NA",
"field5": "",
"field6": ""
}],
"status": "Confirmed"
}],
"field1": "NA"
},
"responseHeader": {
"clientContext": {
"field7": "NA",
"field8": "NA"
},
"field9": "NA",
"field10": "abc",
"field11": "abc"
}
}
I am unable to parse the logs with the below logstash configuration.
input
{
file
{
path => "/elk/logstash-7.0.0/bin/multistepJSON.txt"
start_position => "beginning"
}
}
filter
{
grok
{
match => [ "message", "%{GREEDYDATA:json_payload}"]
}
mutate
{
gsub => ["json_payload","[\r]",""]
}
json
{
source => "json_payload"
#target => "payload"
}
mutate
{
gsub =>["json_payload","\n\t",""]
}
}
output
{
stdout { codec => rubydebug}
}
With this configuration getting jsonfarsefailure
Any help would be appreciated.