Logstash error

Dear sir ;
i want to send a json log file from my local pc to Elasticsearch
my sample json file is
{
"people" : [
{
"firstName": "Joe",
"lastName": "Jackson",
"gender": "male",
"age": 28,
"number": "7349282382"
},
{
"firstName": "James",
"lastName": "Smith",
"gender": "male",
"age": 32,
"number": "5678568567"
},
{
"firstName": "Emily",
"lastName": "Jones",
"gender": "female",
"age": 24,
"number": "456754675"
}
]
}

my configuration file
input {
file{
path=>"/home/mtech4/Downloads/sample4.json"
start_position => "beginning"
sincedb_path => "NUL"
codec => json

}
}
output {
elasticsearch{hosts =>["https://localhost:9200" ]
ssl_certificate_verification=>false
user =>"elastic"
password => "my pass" }
}

i got this error pls help
supported", :exception=>LogStash::Json::ParserError, :data=>" "number": "456754675""}
[ERROR] 2023-04-11 16:16:37.718 [[main]<file] json - JSON parse error, original data now in message field {:message=>"Unexpected close marker '}': expected ']' (for root starting at [Source: (String)" }"; line: 1, column: 0])\n at [Source: (String)" }"; line: 1, column: 6]", :exception=>LogStash::Json::ParserError, :data=>" }"}
[ERROR] 2023-04-11 16:16:37.719 [[main]<file] json - JSON parse error, original data now in message field {:message=>"Unexpected close marker ']': expected '}' (for root starting at [Source: (String)" ]"; line: 1, column: 0])\n at [Source: (String)" ]"; line: 1, column: 4]", :exception=>LogStash::Json::ParserError, :data=>" ]"}
/usr/share/logstash/vendor/bundle/jruby/2.6.0/gems/manticore-0.9.1-java/lib/manticore/client.rb:284: warning: already initialized constant Manticore::Client::HttpPost

If your JSON is pretty-printed then you will need a multiline codec. See this thread.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.