# Logstash elasticsearch filter plugin - set index

**URL:** <https://discuss.elastic.co/t/logstash-elasticsearch-filter-plugin-set-index/37583>\
**Category:** Logstash\
**Created:** [December 18, 2015, 3:02pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-filter-plugin-set-index/37583 "2015-12-18T15:02:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julia\_Murinova](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@Julia\_Murinova](https://discuss.elastic.co/u/Julia_Murinova)\
**Post date:** [December 18, 2015, 3:02pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-filter-plugin-set-index/37583/1 "2015-12-18T15:02:46Z")

</div>

Hi,

I am trying to use elasticsearch filter plugin in logstash to query previous messages for the same session.  
Code:  
elasticsearch {  
hosts =\> ["localhost"]  
query =\> "tags:Connection\_new AND session\_id:%{[session\_id]}"  
fields =\> ["logdate", "started"]  
}   
if ![started] {  
mutate {  
add\_tag =\> "Connection\_new"  
}  
}

However this query returns error for .kibana index [No mapping found for [@timestamp] in order to sort on].  
Is it possible to set index for query to search on using this plugin?

Thank you very much for any help.

---

<div class="post-metadata">

**Author:** ![Hornov](https://avatars.discourse-cdn.com/v4/letter/h/c67d28/32.png) [@Hornov](https://discuss.elastic.co/u/Hornov)\
**Post date:** [December 29, 2015, 9:34am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-filter-plugin-set-index/37583/2 "2015-12-29T09:34:20Z")

</div>

I've the same problem. Before version 2.0 you could add the index in the host but today it is no longer possible. I found this page: [Specify index when using elasticsearch logstash filter](https://discuss.elastic.co/t/specify-index-when-using-elasticsearch-logstash-filter/1928) but I haven't tried to patch the plugin.

---

<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, 5:17am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-filter-plugin-set-index/37583/3 "2017-07-06T05:17:14Z")

</div>


