# Add tags in filebeat modules

**URL:** <https://discuss.elastic.co/t/add-tags-in-filebeat-modules/282750>\
**Category:** Beats\
**Tags:** beats-module, filebeat\
**Created:** [August 29, 2021, 10:39am UTC](https://discuss.elastic.co/t/add-tags-in-filebeat-modules/282750 "2021-08-29T10:39:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![geetika\_gopi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geetika_gopi/32/93548_2.png) [@geetika\_gopi](https://discuss.elastic.co/u/geetika_gopi)\
**Post date:** [August 29, 2021, 10:39am UTC](https://discuss.elastic.co/t/add-tags-in-filebeat-modules/282750/1 "2021-08-29T10:39:16Z")

</div>

Hi all,

I have beats installed on my logstash instance. My idea is to collect multiple logs using filebeat modules -\> send it to logstash on port 5044 -\> send it to elasticsearch.

Can I add tags in each of the filebeat module yml files?  
For eg, Juniper module with "juniper" tag, sophos module with "sophos" tag

This was I can use the tags to send the logs to different indexes

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [August 29, 2021, 3:39pm UTC](https://discuss.elastic.co/t/add-tags-in-filebeat-modules/282750/2 "2021-08-29T15:39:47Z")

</div>

Hi @geetika_gopi

If you use a filebeat module there is already a field that defines which module / dataset it is which can be used for sorting / conditionals in Logstash.

`event.dataset`

Also in a module you should be able to add tags as an input configuration.

```auto
- module: sophos
  xg:
    enabled: true
    input.tags: ["sophos"]
    var.input: udp
    ...

```

---

<div class="post-metadata">

**Author:** ![geetika\_gopi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geetika_gopi/32/93548_2.png) [@geetika\_gopi](https://discuss.elastic.co/u/geetika_gopi)\
**Post date:** [August 29, 2021, 6:26pm UTC](https://discuss.elastic.co/t/add-tags-in-filebeat-modules/282750/3 "2021-08-29T18:26:55Z")

</div>

Hi @stephenb

Thank you for your reply. Pardon me, I am new to the ELK stack. Could you give an example of how we could use the event.dataset field in logstash?

Ideally I would want to use the event.dataset field to send logs to different indexes for different filebeat modules.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [August 29, 2021, 6:34pm UTC](https://discuss.elastic.co/t/add-tags-in-filebeat-modules/282750/4 "2021-08-29T18:34:14Z")

</div>

I suggest you do a little reading about Logstash configurations then open specific questions.

> **[Field References Deep Dive | Logstash Reference \[7.14\] | Elastic](https://www.elastic.co/guide/en/logstash/current/field-references-deepdive.html)**

if [event][dataset]

> **[Accessing Event Data and Fields in the Configuration | Logstash Reference...](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html)**

> **[Logstash Configuration Examples | Logstash Reference \[7.14\] | Elastic](https://www.elastic.co/guide/en/logstash/current/config-examples.html#using-conditionals)**

> **[Logstash Configuration Examples | Logstash Reference \[7.14\] | Elastic](https://www.elastic.co/guide/en/logstash/current/config-examples.html)**

---

<div class="post-metadata">

**Author:** ![geetika\_gopi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geetika_gopi/32/93548_2.png) [@geetika\_gopi](https://discuss.elastic.co/u/geetika_gopi)\
**Post date:** [August 29, 2021, 6:57pm UTC](https://discuss.elastic.co/t/add-tags-in-filebeat-modules/282750/5 "2021-08-29T18:57:03Z")

</div>

Hi @stephenb ,

It is perfectly clear now! Thank you very much for pointing out event.dataset. Exactly what I was looking for 🙂

---

<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 26, 2021, 8:57pm UTC](https://discuss.elastic.co/t/add-tags-in-filebeat-modules/282750/6 "2021-09-26T20:57:28Z")

</div>

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