# How to use percolator while indexing the document using logstash(pre-processing )

**URL:** <https://discuss.elastic.co/t/how-to-use-percolator-while-indexing-the-document-using-logstash-pre-processing/24554>\
**Category:** Logstash\
**Created:** [June 29, 2015, 2:27pm UTC](https://discuss.elastic.co/t/how-to-use-percolator-while-indexing-the-document-using-logstash-pre-processing/24554 "2015-06-29T14:27:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navneet\_Mathpal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/navneet_mathpal/32/3677_2.png) [@Navneet\_Mathpal](https://discuss.elastic.co/u/Navneet_Mathpal)\
**Post date:** [June 29, 2015, 2:27pm UTC](https://discuss.elastic.co/t/how-to-use-percolator-while-indexing-the-document-using-logstash-pre-processing/24554/1 "2015-06-29T14:27:09Z")

</div>

Hi,

I indexed the document using Logstash, but if I need to do some preprocessing using PERCOLATOR how can I do it, is there any possiblities to use percolator in logstash, if not what can be the possible solution for this problem ( TO use percolator before indexing the document ) ?

Best Regards,  
Navneet

---

<div class="post-metadata">

**Author:** ![val](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/val/32/138203_2.png) [@val](https://discuss.elastic.co/u/val)\
**Post date:** [May 4, 2016, 9:09am UTC](https://discuss.elastic.co/t/how-to-use-percolator-while-indexing-the-document-using-logstash-pre-processing/24554/2 "2016-05-04T09:09:03Z")

</div>

I've ventured into creating such a Logstash filter for percolating events inside the Logstash pipeline. It runs very similarly to the `elasticsearch` Logstash filter.

You can find it here

> **[consulthys/logstash-filter-percolate](https://github.com/consulthys/logstash-filter-percolate)**
>
> logstash-filter-percolate - A Logstash filter to percolate events against Elasticsearch

This filter supports percolation of ad-hoc and/or existing documents, e.g.

```
# percolates the event itself
percolate {
    hosts => ["localhost:9200"]
    index => "my_index"
    type => "my_type"
}

# percolates the sub-structure available in event['my_field']
percolate {
    hosts => ["localhost:9200"]
    index => "my_index"
    type => "my_type"
    target => "my_field"
}

# percolates the existing document having the id as specified in the event id field
percolate {
    hosts => ["localhost:9200"]
    index => "my_index"
    type => "my_type"
    id => "%{id}"
}

```

More info at [https://github.com/elastic/logstash/issues/2187#issuecomment-216760668](https://github.com/elastic/logstash/issues/2187#issuecomment-216760668)

---

<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:59am UTC](https://discuss.elastic.co/t/how-to-use-percolator-while-indexing-the-document-using-logstash-pre-processing/24554/3 "2017-07-06T04:59:26Z")

</div>


