# Filter logs from NGINX module

**URL:** https://discuss.elastic.co/t/filter-logs-from-nginx-module/143305
**Category:** Beats
**Tags:** filebeat
**Created:** [August 7, 2018, 11:00am UTC](https://discuss.elastic.co/t/filter-logs-from-nginx-module/143305 "2018-08-07T11:00:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![TheNmaptomyHeartBeat](https://avatars.discourse-cdn.com/v4/letter/t/47e85d/32.png) [@TheNmaptomyHeartBeat](https://discuss.elastic.co/u/TheNmaptomyHeartBeat)
#### Post date: [August 7, 2018, 11:00am UTC](https://discuss.elastic.co/t/filter-logs-from-nginx-module/143305/1 "2018-08-07T11:00:24Z")

</div>

Hello

I am using the NGINX module for Filebeat. Is there a way to filter logs on the machine before it's sent to Elasticsearch?

I much rather carry on using the module than parsing everything through Logstash while using a Grok filter.

Is this possible? I am trying to avoid to alter NGINX logging mechanism, and instead do it through Filebeat module.  
Thank you.

---

<div class="post-metadata">

### Author: ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)
#### Post date: [August 7, 2018, 2:01pm UTC](https://discuss.elastic.co/t/filter-logs-from-nginx-module/143305/2 "2018-08-07T14:01:55Z")

</div>

Hi @TheNmaptomyHeartBeat,

It is possible with the [`drop_event` processor](https://www.elastic.co/guide/en/beats/filebeat/6.3/drop-event.html). With something like this example you can drop all log lines that contain `favicon.ico`:

```auto
processors:
 - drop_event:
     when:
        message.contains: 'favicon.ico'

```

---

<div class="post-metadata">

### Author: ![TheNmaptomyHeartBeat](https://avatars.discourse-cdn.com/v4/letter/t/47e85d/32.png) [@TheNmaptomyHeartBeat](https://discuss.elastic.co/u/TheNmaptomyHeartBeat)
#### Post date: [August 13, 2018, 9:40am UTC](https://discuss.elastic.co/t/filter-logs-from-nginx-module/143305/3 "2018-08-13T09:40:16Z")

</div>

Hi @jsoriano  
That works brilliantly thank you very much.

---

<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: [September 10, 2018, 9:40am UTC](https://discuss.elastic.co/t/filter-logs-from-nginx-module/143305/4 "2018-09-10T09:40:16Z")

</div>

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