Hi team
I have file in json format.
[
{
"year": 2013,
"title": "Rush",
"info": {
"directors": ["Ron Howard"],
"release_date": "2013-09-02T00:00:00Z",
"rating": 8.3,
"genres": [
"Action",
"Biography",
"Drama",
"Sport"
],
"image_url": "http://ia.media-imdb.com/images/M/MV5BMTQyMDE0MTY0OV5BMl5BanBnXkFtZTcwMjI2OTI0OQ@@._V1_SX400_.jpg",
"plot": "A re-creation of the merciless 1970s rivalry between Formula One rivals James Hunt and Niki Lauda.",
"rank": 2,
"running_time_secs": 7380,
"actors": [
"Daniel Bruhl",
"Chris Hemsworth",
"Olivia Wilde"
]
}
}
]
i want to parse this file and i am dealing with error in logstash json filter
input
{
file {
path => "/usr/share/logstash/moviedata.json"
start_position => "beginning"
#sincedb_path => "/usr/share/logstash/dbteste"
}
}
filter {
json {
source => "message"
}
}
logstash logs
[2021-12-29T16:01:13,824][WARN ][logstash.filters.json ][movie][2e0349d64f8ab2889caf33284adb464eb2adf3d4b19e77ad5922b144d2a77e57] Error parsing json {:source=>"message", :raw=>" }", :exception=>#<LogStash::Json::ParserError: Unexpected close marker '}': expected ']' (for root starting at [Source: (byte[])" }"; line: 1, column: 0])
at [Source: (byte[])" }"; line: 1, column: 6]>}
[2021-12-29T16:01:13,825][WARN ][logstash.filters.json ][movie][2e0349d64f8ab2889caf33284adb464eb2adf3d4b19e77ad5922b144d2a77e57] Error parsing json {:source=>"message", :raw=>" \"Action\",", :exception=>#<LogStash::Json::ParserError: Unexpected character (',' (code 44)): expected a value
at [Source: (byte[])" "Action","; line: 1, column: 26]>}
[2021-12-29T16:01:13,830][WARN ][logstash.filters.json ][movie][2e0349d64f8ab2889caf33284adb464eb2adf3d4b19e77ad5922b144d2a77e57] Error parsing json {:source=>"message", :raw=>" \"Biography\",", :exception=>#<LogStash::Json::ParserError: Unexpected character (',' (code 44)): expected a value
at [Source: (byte[])" "Biography","; line: 1, column: 29]>}
[2021-12-29T16:01:13,836][WARN ][logstash.filters.json ][movie][2e0349d64f8ab2889caf33284adb464eb2adf3d4b19e77ad5922b144d2a77e57] Error parsing json {:source=>"message", :raw=>" \"plot\": \"A re-creation of the merciless 1970s rivalry between Formula One rivals James Hunt and Niki Lauda.\",", :exception=>#<LogStash::Json::ParserError: Unexpected character (':' (code 58)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
at [Source: (byte[])" "plot": "A re-creation of the merciless 1970s rivalry between Formula One rivals James Hunt and Niki Lauda.","; line: 1, column: 20]>}
[2021-12-29T16:01:13,837][WARN ][logstash.filters.json ][movie][2e0349d64f8ab2889caf33284adb464eb2adf3d4b19e77ad5922b144d2a77e57] Error parsing json {:source=>"message", :raw=>" \"Daniel Bruhl\",", :exception=>#<LogStash::Json::ParserError: Unexpected character (',' (code 44)): expected a value
at [Source: (byte[])" "Daniel Bruhl","; line: 1, column: 32]>}