Logstash filter for json is not using jason file date


(Rijin) #1

Hi All ,

I am uploading log from a json file . Logstash filter is working . But the same time 2 times log is uploading to elasticsearch , with log date and current date .

example :

jason log

{"index": {"_index":"server-metrics","_type":"metric","_id":"680464"}}
{"@timestamp":"2017-04-15T00:07:00","accept":34258,"deny":7049,"host":"server_2","response":2.5074651,"service":"app_3","total":41307}
{"index": {"_index":"server-metrics","_type":"metric","_id":"680465"}}
{"@timestamp":"2017-04-15T00:07:00","accept":11253,"deny":594,"host":"server_3","response":2.2844904708,"service":"app_2","total":11847}

Logstash filter

input{
file {
start_position => "beginning"
path => "/home/elastic/elk/samplelog/server-metrics_4.json"
codec => "json"
type => "json"
}
}
output { stdout{ codec => rubydebug }
elasticsearch { hosts => ["127.0.0.1:9200"]
}

Log is indexed to both at date "2017-04-15T00:07:00" and current date 9/1/2018


(system) #2

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