# Tags vs Fields

**URL:** https://discuss.elastic.co/t/tags-vs-fields/24014
**Category:** Logstash
**Created:** [June 19, 2015, 7:48pm UTC](https://discuss.elastic.co/t/tags-vs-fields/24014 "2015-06-19T19:48:14Z")
**Posts on this page:** 1
**Showing post:** 4

<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: [June 22, 2015, 2:17pm UTC](https://discuss.elastic.co/t/tags-vs-fields/24014/4 "2015-06-22T14:17:46Z")

</div>

> Still confused probably both can be used to quickly query for a specific attribute.

Yes.

> Does this mean I should only add fields when I do not need to do conditionals in my filter? Otherwise if i just need to quickly search I can do it through a field? Or if my purpose is to find an event, on say kibana, I should use a field or tag?

Either way, really. Tags are a way of attaching boolean values to events, i.e.

```
{
  "tags": [
    "foo",
    "bar"
  ]
}

```

isn't much different from this:

```
{
  "foo": true,
  "bar": true
}

```

Apart from the obvious difference in syntax there's another thing: In the latter case a new "tag value" created as a field will affect the mapping of the type but adding a new string to the `tags` list (which is just a regular Logstash field) won't.

In the end a tag is just a special-purpose field used as a shorthand for slapping, well, a tag onto a document.

---

_[View the full topic](https://discuss.elastic.co/t/tags-vs-fields/24014)._
