Logstash Json Input

Hi.

I have a problem with my input and pipeline. i'm new with pipelines and json filter.

I don't know how to get logstash filter my json files and send to elasticsearch.

This a exemple of my json file:

{"tenantID": 80454, "Size": 0.02, "FirstDate": "21/12/2019 08:29:08", "LastDate": "21/12/2019 22:45:32"}

And this is my actual pipeline for json files:

input {
file {
type => "json"
path => "/usr/share/logstash/inputlogs/*.json"
start_position => "beginning"
sincedb_path => "/usr/share/logstash/.sincedb"
}
}

filter {

    json {
            source => "message"
    }

}

output {
elasticsearch {
hosts => "elasticsearch:9200"
index => "lab-benchmarking-json"
}
stdout {}
}

what it's wrong with my pipeline??

Thanks for advanced.

Hi

What is the output of your stdout{} and how doees it differ from what you expect/need?

Hi i can't see any output on logstash it's strange. And i need elastic create a index for this and i expect see all fields that my json file has on elasticsearch.

Thanks for advanced.

Have you checked /var/log/logstash for any errors?

Have you created the index in elasticsearch first before trying to index? Do this through Kibana

Don't show any error.

Index is created on logstash with output.

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