# Help with logstash filter

**URL:** <https://discuss.elastic.co/t/help-with-logstash-filter/218154>\
**Category:** Logstash\
**Created:** [February 6, 2020, 10:58am UTC](https://discuss.elastic.co/t/help-with-logstash-filter/218154 "2020-02-06T10:58:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ademir.andrade](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@ademir.andrade](https://discuss.elastic.co/u/ademir.andrade)\
**Post date:** [February 6, 2020, 10:58am UTC](https://discuss.elastic.co/t/help-with-logstash-filter/218154/1 "2020-02-06T10:58:54Z")

</div>

Good morning, I would like a help to make a filter in the logstash, I do not want the logstash to process the one of a certain IP range, also including multicast and broadcast.  
I thank you for your help.

---

<div class="post-metadata">

**Author:** ![A\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_b/32/17104_2.png) [@A\_B](https://discuss.elastic.co/u/A_B)\
**Post date:** [February 6, 2020, 3:37pm UTC](https://discuss.elastic.co/t/help-with-logstash-filter/218154/2 "2020-02-06T15:37:56Z")

</div>

Hi @ademir.andrade,

could you give a bit more details? Sounds like you want to filter an `input`. Not sure if that is possible.

How are you sending data to Logstash?

---

<div class="post-metadata">

**Author:** ![ademir.andrade](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@ademir.andrade](https://discuss.elastic.co/u/ademir.andrade)\
**Post date:** [February 6, 2020, 4:00pm UTC](https://discuss.elastic.co/t/help-with-logstash-filter/218154/3 "2020-02-06T16:00:30Z")

</div>

I don't have any filters applied, I'm receiving data from some routers, and I noticed these ips as 0.0.0.0 and 224.0.0

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 6, 2020, 4:21pm UTC](https://discuss.elastic.co/t/help-with-logstash-filter/218154/4 "2020-02-06T16:21:14Z")

</div>

If there is a small set of IPs you want to drop you could just use something like

```
if [fieldWithIp] =~ /(1.2.3.4|1.4.5.6|1.6.7.8)/ { drop {} }

```

Alternatively, you could use a cidr filter to tag the events and drop them if they get tagged.

---

<div class="post-metadata">

**Author:** ![ademir.andrade](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@ademir.andrade](https://discuss.elastic.co/u/ademir.andrade)\
**Post date:** [February 7, 2020, 10:59am UTC](https://discuss.elastic.co/t/help-with-logstash-filter/218154/5 "2020-02-07T10:59:16Z")

</div>

Thanks for the tip, I'm doing the tests.

---

<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:** [March 6, 2020, 10:59am UTC](https://discuss.elastic.co/t/help-with-logstash-filter/218154/6 "2020-03-06T10:59:17Z")

</div>

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