# Logstash not indexing the input data to elastic search

**URL:** <https://discuss.elastic.co/t/logstash-not-indexing-the-input-data-to-elastic-search/62659>\
**Category:** Logstash\
**Created:** [October 10, 2016, 7:01pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-the-input-data-to-elastic-search/62659 "2016-10-10T19:01:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![satheeshravir](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@satheeshravir](https://discuss.elastic.co/u/satheeshravir)\
**Post date:** [October 10, 2016, 7:01pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-the-input-data-to-elastic-search/62659/1 "2016-10-10T19:01:00Z")

</div>

Hi,  
I am trying to feed json array to elastic search. Its not throwing any error and not indexing the data to elastic search. I have given my config below. Please let me know if am making any mistake in my config.

input {  
file {  
path =\> "/Users/me/practice/logstash-2.4.0/stash/\*.json"  
codec =\> "json"  
start\_position =\> "beginning"  
}  
}  
filter{  
ruby {  
code =\> "event['@metadata']['\_id'] = event['\_id']"  
}  
mutate{  
remove\_field =\> ["\_id","path","host"]  
}  
}  
output {  
elasticsearch {  
hosts =\> ["localhost:9200"]  
index =\> "logs"  
document\_id =\> "%{[@metadata][\_id]}"  
}  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 10, 2016, 8:06pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-the-input-data-to-elastic-search/62659/2 "2016-10-10T20:06:02Z")

</div>

Please check out the Logstash posts from the past couple of days. I recall at least two people asking the same question.

What I can add is: Do not use the elasticsearch output until you've verified that your input files are being correctly read and processed. Use a `stdout { codec => rubydebug }` output instead.

---

<div class="post-metadata">

**Author:** ![satheeshravir](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@satheeshravir](https://discuss.elastic.co/u/satheeshravir)\
**Post date:** [October 10, 2016, 8:16pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-the-input-data-to-elastic-search/62659/3 "2016-10-10T20:16:51Z")

</div>

Thank you for the response. I checked adding stdout. I don't see anything there. I can assume then its a problem with input plugin or its config. However when I add a specific json file. Its processing content of that particular file only. Any thoughts?

---

<div class="post-metadata">

**Author:** ![satheeshravir](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@satheeshravir](https://discuss.elastic.co/u/satheeshravir)\
**Post date:** [October 10, 2016, 8:52pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-the-input-data-to-elastic-search/62659/4 "2016-10-10T20:52:38Z")

</div>

I checked the logs in debug mode. It prints the following repeatedly without processing the file content.

> file grew: /Users/satheeshravi/practice/logstash-2.4.0/stash/my.json: old size 0, new size 994 {:level=\>:debug, :file=\>"filewatch/watch.rb", :line=\>"254", :method=\>"each"}  
> each: file grew: /Users/satheeshravi/practice/logstash-2.4.0/stash/test1.json: old size 0, new size 994 {:level=\>:debug, :file=\>"filewatch/watch.rb", :line=\>"254", :method=\>"each"}  
> each: file grew: /Users/satheeshravi/practice/logstash-2.4.0/stash/test1476119896.json: old size 0, new size 42459 {:level=\>:debug, :file=\>"filewatch/watch.rb", :line=\>"254", :method=\>"each"}

---

<div class="post-metadata">

**Author:** ![satheeshravir](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@satheeshravir](https://discuss.elastic.co/u/satheeshravir)\
**Post date:** [October 10, 2016, 11:12pm UTC](https://discuss.elastic.co/t/logstash-not-indexing-the-input-data-to-elastic-search/62659/5 "2016-10-10T23:12:53Z")

</div>

Created an issue for file input plugin

> <https://github.com/logstash-plugins/logstash-input-file/issues/145>

---

<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:** [July 6, 2017, 4:34am UTC](https://discuss.elastic.co/t/logstash-not-indexing-the-input-data-to-elastic-search/62659/6 "2017-07-06T04:34:50Z")

</div>


