# 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:** 1
**Showing post:** 2

<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)

---

_[View the full topic](https://discuss.elastic.co/t/how-to-use-percolator-while-indexing-the-document-using-logstash-pre-processing/24554)._
