# Filebeat processor add tags to log files from different folders

**URL:** https://discuss.elastic.co/t/filebeat-processor-add-tags-to-log-files-from-different-folders/204226
**Category:** Beats
**Tags:** filebeat
**Created:** [October 18, 2019, 12:39pm UTC](https://discuss.elastic.co/t/filebeat-processor-add-tags-to-log-files-from-different-folders/204226 "2019-10-18T12:39:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ryan\_Downey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryan_downey/32/35987_2.png) [@Ryan\_Downey](https://discuss.elastic.co/u/Ryan_Downey)
#### Post date: [October 18, 2019, 12:39pm UTC](https://discuss.elastic.co/t/filebeat-processor-add-tags-to-log-files-from-different-folders/204226/1 "2019-10-18T12:39:34Z")

</div>

Filebeat 7.4.0

I've been trying to work off of the link below to add tags to logs that are coming from different folders. We have multiple different log folders like vdi001, vdimgmt001 and flx001 and we'd like to use filebeat to tag the logs as their shipped. It seems like the \_add\_tags: when: conditional: format is the way to go but after that I'm not sure what the syntax is. I've been trying the log.file.path option like the other thread has but cant seem to get it to work.

> [@Multiple processors with same name - add\_tags](https://discuss.elastic.co/t/multiple-processors-with-same-name-add-tags/184060):
>
> Hello, is it possible to create configuration with multiple processors, using same processor name, but different conditions? I`d like to add tags for specific log files, like all \*.log files must be tagged as "log" but all \*.out files, as "out", same time - access.log I would like to tagg as "access". Tried to add multiple processors in filebeat.yml: processors: - add\_tags: when: contains: log.file.path: ".log" tags: ["log"] processors: - add\_tags: when: contai…

```auto
processors:
  - add_tags:
      when:
        contains:
          log.file.path: "/logs/vdi001/vdi001.*.log"
      tags: ["vdi","esx"]

```

---

<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: [November 15, 2019, 12:39pm UTC](https://discuss.elastic.co/t/filebeat-processor-add-tags-to-log-files-from-different-folders/204226/2 "2019-11-15T12:39:41Z")

</div>

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