# Logstash filter not working

**URL:** https://discuss.elastic.co/t/logstash-filter-not-working/321948
**Category:** Logstash
**Created:** [December 23, 2022, 8:28pm UTC](https://discuss.elastic.co/t/logstash-filter-not-working/321948 "2022-12-23T20:28:08Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![parisila](https://avatars.discourse-cdn.com/v4/letter/p/3ec8ea/32.png) [@parisila](https://discuss.elastic.co/u/parisila)
#### Post date: [December 23, 2022, 8:28pm UTC](https://discuss.elastic.co/t/logstash-filter-not-working/321948/1 "2022-12-23T20:28:08Z")

</div>

I have filebeat, logstash and elasticsearch. My logstash config.d looks like this

![logstashconfig](https://us1.discourse-cdn.com/elastic/original/3X/6/f/6f7e8b0c782f6ecaf69037d5d4326f9983519fba.png)

02-beats-input.conf receives the message from filebeat  
30-elasticsearch-output.conf sends to elasticsearch ingest pipeline. Logstash doesn't do any parsing.  
I am trying to implement filters for the various logs but they don't seem to be working.  
The 12-system.syslog-filter.conf is like this

 ![syslogfilter](https://us1.discourse-cdn.com/elastic/original/3X/6/5/65c9d2b10c3d37ade8905982fd27f0f7a7105e9c.png)

I have tried several iterations and snippets from others but I am still getting the messages that I expect to be filtered shown in my Kibana search.

Sorry, I can't post actual code as the system is in a secure environment with no copy out so that is why screenshots

---

<div class="post-metadata">

### Author: ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)
#### Post date: [December 25, 2022, 11:34pm UTC](https://discuss.elastic.co/t/logstash-filter-not-working/321948/2 "2022-12-25T23:34:58Z")

</div>

It's working for me if test with `if ("Created slice" in [message]) { ...` on the latest LS version.

Have you tried with?  
`if ([message] =~ /\ACreated slice/ ) { drop {} }`

Are you sure that both IFs are working? [event][module] and [fileset][name] ?

---

<div class="post-metadata">

### Author: ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)
#### Post date: [December 26, 2022, 8:29am UTC](https://discuss.elastic.co/t/logstash-filter-not-working/321948/3 "2022-12-26T08:29:36Z")

</div>

One more thing, check are nested fields or with dots. For instance, "event": { "modules": "system" } might be: "event.modules": "system". You will see it in Kibana - JSON view.

---

<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: [January 23, 2023, 8:30am UTC](https://discuss.elastic.co/t/logstash-filter-not-working/321948/4 "2023-01-23T08:30:35Z")

</div>

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