# Filter the data sent by filebeat

**URL:** <https://discuss.elastic.co/t/filter-the-data-sent-by-filebeat/90288>\
**Category:** Logstash\
**Created:** [June 21, 2017, 12:36pm UTC](https://discuss.elastic.co/t/filter-the-data-sent-by-filebeat/90288 "2017-06-21T12:36:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam67000](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@Sam67000](https://discuss.elastic.co/u/Sam67000)\
**Post date:** [June 21, 2017, 12:36pm UTC](https://discuss.elastic.co/t/filter-the-data-sent-by-filebeat/90288/1 "2017-06-21T12:36:14Z")

</div>

Hello Everyone,

I have a small problem with filebeat and logstash.

On my logstash machine I receive data from two different servers (filebeat). The problem is that I don't want to apply the same filters to the 2 servers because they send different logs.

So my question is how to make logstash know what log it receives and what filter apply to it.

Thank you a lot.

---

<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:** [June 21, 2017, 12:40pm UTC](https://discuss.elastic.co/t/filter-the-data-sent-by-filebeat/90288/2 "2017-06-21T12:40:26Z")

</div>

On the Filebeat side set different types for each type of log (use the `document_type` option), then use conditionals on the Logstash side to choose which filters to use for each type.

[https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html)

---

<div class="post-metadata">

**Author:** ![Sam67000](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@Sam67000](https://discuss.elastic.co/u/Sam67000)\
**Post date:** [June 22, 2017, 10:06am UTC](https://discuss.elastic.co/t/filter-the-data-sent-by-filebeat/90288/3 "2017-06-22T10:06:10Z")

</div>

Thank you very much it's work !

I have another question now: how do I send the data in different indexes ? (elasticsearch)

---

<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:** [June 22, 2017, 10:16am UTC](https://discuss.elastic.co/t/filter-the-data-sent-by-filebeat/90288/4 "2017-06-22T10:16:41Z")

</div>

You can use conditionals in the output section too.

---

<div class="post-metadata">

**Author:** ![Sam67000](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@Sam67000](https://discuss.elastic.co/u/Sam67000)\
**Post date:** [June 26, 2017, 8:57am UTC](https://discuss.elastic.co/t/filter-the-data-sent-by-filebeat/90288/5 "2017-06-26T08:57:53Z")

</div>

It works. Thank you for your help @magnusbaeck !

---

<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 24, 2017, 8:57am UTC](https://discuss.elastic.co/t/filter-the-data-sent-by-filebeat/90288/6 "2017-07-24T08:57:55Z")

</div>

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