# How to get a record from ElasticSearch in the logstash filter?

**URL:** <https://discuss.elastic.co/t/how-to-get-a-record-from-elasticsearch-in-the-logstash-filter/107297>\
**Category:** Logstash\
**Created:** [November 12, 2017, 11:28am UTC](https://discuss.elastic.co/t/how-to-get-a-record-from-elasticsearch-in-the-logstash-filter/107297 "2017-11-12T11:28:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harim\_Tong](https://avatars.discourse-cdn.com/v4/letter/h/dc4da7/32.png) [@Harim\_Tong](https://discuss.elastic.co/u/Harim_Tong)\
**Post date:** [November 12, 2017, 11:28am UTC](https://discuss.elastic.co/t/how-to-get-a-record-from-elasticsearch-in-the-logstash-filter/107297/1 "2017-11-12T11:28:32Z")

</div>

How to get a record by \_id (or other fields) from ElasticSearch in a logstash filter stage?

I know the Elasticsearch provides the Get API like: curl -XHEAD -i '[http://localhost:9200/twitter/tweet/1](http://localhost:9200/twitter/tweet/1)' to get a record from ElasticSearch(ES) , but I don't know how to get the same record from logstash filter.

Can anyone help? Thanks in advance.

---

<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:** [November 14, 2017, 6:35am UTC](https://discuss.elastic.co/t/how-to-get-a-record-from-elasticsearch-in-the-logstash-filter/107297/2 "2017-11-14T06:35:34Z")

</div>

Have you looked at the elasticsearch filter?

---

<div class="post-metadata">

**Author:** ![Harim\_Tong](https://avatars.discourse-cdn.com/v4/letter/h/dc4da7/32.png) [@Harim\_Tong](https://discuss.elastic.co/u/Harim_Tong)\
**Post date:** [November 16, 2017, 6:48am UTC](https://discuss.elastic.co/t/how-to-get-a-record-from-elasticsearch-in-the-logstash-filter/107297/3 "2017-11-16T06:48:29Z")

</div>

it works ,thanks.

---

<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 14, 2017, 6:48am UTC](https://discuss.elastic.co/t/how-to-get-a-record-from-elasticsearch-in-the-logstash-filter/107297/4 "2017-12-14T06:48:51Z")

</div>

Closed on December 14, 2017, 6:48am UTC

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