# How to Add Tags to Fluentd Events

Here is how you can add tags to Fluentd events.


Let's assume you configured Fluentd to process Nginx access logs from the `access.log` file with a source configuration like this:

```text
[label /etc/fluent/fluentd.conf]
<source>
   @type tail
   path /var/log/nginx/access.log
   pos_file /var/log/access.log.pos
   format nginx
</source>
```

To organize and identify these logs effectively, you can assign a specific tag using the `tag` property in the configuration. Here's how you can set it:

```text
[label /etc/fluent/fluentd.conf]
<source>
   @type tail
   path /var/log/nginx/access.log
   pos_file /var/log/access.log.pos
   tag nginx.access
   format nginx
</source>
```

In this example, the logs are tagged with `nginx.access`. This tag is crucial as it allows you to filter or match logs based on it in subsequent Fluentd configurations.

Now, with the tag defined, it can be referenced in a `match` or `filter` directive. Here's an example of using the `match` directive to forward all logs with the `nginx.access` tag to standard output:

```text
<source>
   @type tail
   path /var/log/nginx/access.log
   pos_file /var/log/access.log.pos
   tag nginx.access
   format nginx
</source>

<match nginx.access>
   @type stdout
</match>
```

This setup ensures that all log events tagged as `nginx.access` are directed to the standard output, providing a streamlined way to manage and view these specific logs.

## 🔭 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)