Hi All,
I'm trying to ingest a json file using logstash adn i'm getting json parse failure message, can someone guide me where i'm doing the mistake
My json FIle
[
{
"Org": "ogr1",
"date_last": "2020-01-14 02:02:06",
"did": 3100,
"emessage": "snmpInTotalReqVars : Value is high",
"eseverity": 3,
"esource": 4,
"event_id": 242913,
"ext_ticket_ref": "INC0601526",
"hostname": "server1.yourdomain.com",
"ip": "12.2.0.6",
"notify_count": 3,
"roa_id": 2,
"user_ack": 26
},
{
"Org": "ogr1",
"date_last": "2020-02-24 03:21:04",
"did": 3100,
"emessage": "snmpInTotalReqVars : Value is high",
"eseverity": 3,
"esource": 4,
"event_id": 476,
"ext_ticket_ref": "INC0926941",
"hostname": "server1.yourdomain.com",
"ip": "12.2.0.6",
"notify_count": 1,
"roa_id": 2,
"user_ack": 0
},
{
"Org": "ogr2",
"date_last": "2020-03-10 02:06:04",
"did": 3100,
"emessage": "snmpInTotalReqVars : Value is high",
"eseverity": 3,
"esource": 4,
"event_id": 476,
"ext_ticket_ref": "INC0926941",
"hostname": "server2.yourdomain.com",
"ip": "12.2.0.2",
"notify_count": 1,
"roa_id": 2,
"user_ack": 0
},
{
"Org": "ogr2",
"date_last": "2020-03-11 02:06:05",
"did": 3100,
"emessage": "snmpInTotalReqVars : Value is high",
"eseverity": 3,
"esource": 4,
"event_id": 476,
"ext_ticket_ref": "INC0926941",
"hostname": "server2.yourdomain.com",
"ip": "12.2.0.2",
"notify_count": 1,
"roa_id": 2,
"user_ack": 0
},
]
My config file
input {
file {
path => "/opt/curl_output/data.json"
start_position => "beginning"
sincedb_path => "/dev/null"
codec => "json"
}
}
filter {
json {
source => "message"
target => "parsed"
}
}
output {
elasticsearch {
hosts => ["https://elastic.co:9243"]
user => "*****"
password => "*****"
index => "perf-test"
}
# stdout { codec => rubydebug }
}
Below is one of the line from error message
2020-04-27T18:59:44,929][ERROR][logstash.codecs.json ][main] JSON parse error, original data now in message field {:error=>#<LogStash::Json::ParserError: incompatible json object type=java.lang.String , only hash map or arrays are supported>, :data=>" \"did\": \"4333\","}
Not sure what mistake i'm doing, the error message is there for every single line of my json.
Any ideas and suggestions will be great help for me.
Thanks
Gautham