# While using elastic search as the input, not able to fetch data using the same index in elastic seach plugin for filter

**URL:** <https://discuss.elastic.co/t/while-using-elastic-search-as-the-input-not-able-to-fetch-data-using-the-same-index-in-elastic-seach-plugin-for-filter/158702>\
**Category:** Logstash\
**Created:** [November 29, 2018, 7:46am UTC](https://discuss.elastic.co/t/while-using-elastic-search-as-the-input-not-able-to-fetch-data-using-the-same-index-in-elastic-seach-plugin-for-filter/158702 "2018-11-29T07:46:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AtulShukla\_281194](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@AtulShukla\_281194](https://discuss.elastic.co/u/AtulShukla_281194)\
**Post date:** [November 29, 2018, 7:46am UTC](https://discuss.elastic.co/t/while-using-elastic-search-as-the-input-not-able-to-fetch-data-using-the-same-index-in-elastic-seach-plugin-for-filter/158702/1 "2018-11-29T07:46:05Z")

</div>

Below is my code :  
input {  
elasticsearch {  
hosts =\> "xxxx"  
index =\> "abcd\*"  
query=\> ' {  
"query":{  
"range":{  
"@timestamp":{  
"gte":"2018-11-29T11:54:01.600113354Z",  
"lt":"2018-11-29T11:57:01.600113354Z"  
}  
}  
}  
}'  
}  
}  
filter {  
elasticsearch {  
hosts =\> "xxxx"  
index =\> "abcd\*"  
query =\> 'value\_needed:"%{value\_needed}"'  
fields =\> {  
"field1" =\> "field1"  
}  
}

```
	}

```

: Not able to fetch the field1 value from abcd index. Can someone please help with this.

---

<div class="post-metadata">

**Author:** ![Eniqmatic](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@Eniqmatic](https://discuss.elastic.co/u/Eniqmatic)\
**Post date:** [November 29, 2018, 8:14am UTC](https://discuss.elastic.co/t/while-using-elastic-search-as-the-input-not-able-to-fetch-data-using-the-same-index-in-elastic-seach-plugin-for-filter/158702/2 "2018-11-29T08:14:34Z")

</div>

Any errors or what is happening? Try removing the "lt" timestamp to see if that helps you get some results at first.

---

<div class="post-metadata">

**Author:** ![AtulShukla\_281194](https://avatars.discourse-cdn.com/v4/letter/a/e95f7d/32.png) [@AtulShukla\_281194](https://discuss.elastic.co/u/AtulShukla_281194)\
**Post date:** [November 29, 2018, 9:44am UTC](https://discuss.elastic.co/t/while-using-elastic-search-as-the-input-not-able-to-fetch-data-using-the-same-index-in-elastic-seach-plugin-for-filter/158702/3 "2018-11-29T09:44:25Z")

</div>

Hi Lewis,  
From the input elastic plugin, I am getting data.

The problem comes when I am trying to open the connection again to the same database.  
No error log is generated in logstash.

---

<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:** [December 27, 2018, 9:55am UTC](https://discuss.elastic.co/t/while-using-elastic-search-as-the-input-not-able-to-fetch-data-using-the-same-index-in-elastic-seach-plugin-for-filter/158702/4 "2018-12-27T09:55:45Z")

</div>

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