# Logstash filter for json is not using jason file date

**URL:** <https://discuss.elastic.co/t/logstash-filter-for-json-is-not-using-jason-file-date/114672>\
**Category:** Logstash\
**Created:** [January 9, 2018, 9:48am UTC](https://discuss.elastic.co/t/logstash-filter-for-json-is-not-using-jason-file-date/114672 "2018-01-09T09:48:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rijinmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rijinmp/32/24634_2.png) [@rijinmp](https://discuss.elastic.co/u/rijinmp)\
**Post date:** [January 9, 2018, 9:48am UTC](https://discuss.elastic.co/t/logstash-filter-for-json-is-not-using-jason-file-date/114672/1 "2018-01-09T09:48:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 6, 2018, 9:48am UTC](https://discuss.elastic.co/t/logstash-filter-for-json-is-not-using-jason-file-date/114672/2 "2018-02-06T09:48:52Z")

</div>

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