# How to setup tags?

**URL:** <https://discuss.elastic.co/t/how-to-setup-tags/31454>\
**Category:** Logstash\
**Created:** [October 1, 2015, 8:50am UTC](https://discuss.elastic.co/t/how-to-setup-tags/31454 "2015-10-01T08:50:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mne](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mne/32/7328_2.png) [@mne](https://discuss.elastic.co/u/mne)\
**Post date:** [October 1, 2015, 8:50am UTC](https://discuss.elastic.co/t/how-to-setup-tags/31454/1 "2015-10-01T08:50:01Z")

</div>

Hi all,

i'm trying to configure logstash-forwarder to send a tag with every event, but it fails:  
I've tried:  
"fields": { "type": "eslog" },  
"tags": ["esnode1"]

But this seems to be ignored...  
If i add it as field e.g. "fields": { "type": "eslog", tags: "esnode1" } it becomes a string, so adding other tags in filter section results in "tags":"esnode1\_grokparsefailure..."  
If i define it as an array in fields, LSF complains "json: cannot unmarshal array into Go value of type string"

Any hint?

Regards,  
Marcus

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 1, 2015, 9:17am UTC](https://discuss.elastic.co/t/how-to-setup-tags/31454/2 "2015-10-01T09:17:26Z")

</div>

The LSF configuration doesn't support a `tags` field so the only way to pass a (singular) tag is via `fields`.

> If i define it as an array in fields, LSF complains "json: cannot unmarshal array into Go value of type string"

Yes, fields set in LSF need to be strings. I don't know why, really. Seems like an unnecessary limitation. LSF is being deprecated in favor of filebeat and filebeat has the same limitation. I've filed [github.com/elastic/filebeat/issue #69](https://github.com/elastic/filebeat/issues/69) for this.

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [October 5, 2015, 7:38am UTC](https://discuss.elastic.co/t/how-to-setup-tags/31454/3 "2015-10-05T07:38:29Z")

</div>

@mne @magnusbaeck Lets continue the discussion directly in the open Github issue: [https://github.com/elastic/filebeat/issues/69](https://github.com/elastic/filebeat/issues/69)

---

<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:** [July 6, 2017, 5:27am UTC](https://discuss.elastic.co/t/how-to-setup-tags/31454/4 "2017-07-06T05:27:21Z")

</div>


