Unable to parse JSON file and send it to elasticsearch

Hi,

I am trying to parse a JSON log file generated by an application and send it to elasticsearch and from there to kibana. I have tried so many methods, but there is no luck. Below is the logstash config file i am using. Please help me.

input {
file {
codec => json
path => "/home/test/*"
sincedb_path => "dev/null"
start_position => "beginning"
}
}
filter {
if [tags][json] {
json {
source => "message"
}
}
}
output {
elasticsearch {
hosts => [ "10.0.2.15:9200" ]
}
}

I'm assuming you're trying out Logstash from a shell rather than running it as a service.

sincedb_path => "dev/null"

Unless you're running Logstash from the file system's root this should be:

sincedb_path => "/dev/null"

Before attempting to get anything into Elasticsearch, use a stdout { codec => rubydebug } output and verify that you're getting stuff to stdout. Once that works you can reenable the elasticsearch output.

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