#  How to exclude pattern in <match> for fluentd config?

To selectively filter log events in Fluentd, you can use the `<match>` directive to specify which events to process and which to discard. Here's how you can do it:

To discard all events that match a specific tag and process all other tags, you can configure Fluentd like this:

```text
[label /etc/fluent/fluentd.conf]
<match the.tag.you.want.to.drop>
  @type null
</match>
<match **>
  # process everything else
</match>
```

The [`null`](https://docs.fluentd.org/output/null) output plugin effectively discards all log events that match the specified tag.

On the other hand, if you want to drop all events except those with a specific tag, the configuration would look like this:

```text
[label /etc/fluent/fluentd.conf]
<match the.tag.you.want.to.process>
  # process this specific tag
</match>
```

In this setup, only the events matching `the.tag.you.want.to.process` are processed, and all others are ignored. However, Fluentd will issue a warning for unprocessed tags.

To eliminate this warning and explicitly discard all other log events, you can direct them to the `null` output plugin, like this:

```text
<match the.tag.you.want.to.process>
  # process this specific tag
</match>
<match **>
  @type null
</match>
```

This approach ensures a clean configuration where specific tags are processed, and all others are silently discarded, maintaining an efficient log management system.

## 🔭 Want to centralize and monitor your logs?
Go to [Logtail](https://betterstack.com/logtail/) and start your log management in 5 minutes.
[/summary]
![Better Uptime Dashboard](https://imagedelivery.net/xZXo0QFi-1_4Zimer-T0XQ/08b5b6cb-f57b-4ff4-cf1d-b303b8a94e00/public =1247x768)