# Working of add tag in multiline

**URL:** <https://discuss.elastic.co/t/working-of-add-tag-in-multiline/29733>\
**Category:** Logstash\
**Created:** [September 21, 2015, 9:08pm UTC](https://discuss.elastic.co/t/working-of-add-tag-in-multiline/29733 "2015-09-21T21:08:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vilas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vilas/32/613_2.png) [@vilas](https://discuss.elastic.co/u/vilas)\
**Post date:** [September 21, 2015, 9:08pm UTC](https://discuss.elastic.co/t/working-of-add-tag-in-multiline/29733/1 "2015-09-21T21:08:54Z")

</div>

Hi,

I am using Logstash 1.4.2.  
When we do add\_tag in multiline filter, it seems like it is not adding any tag.

Following is my **logstash conf** :

```auto
filter {
	grok {
		match => { "message" => "^Start Line.*" }
		add_field => { "header" => " " }
		add_field => { "first" => " " }
		add_field => { "last" => " " }
	}
	
	multiline {
		pattern => "^line.*|^$"
		what => "previous"
		add_tag => ["isHeader"]
	}
	
	if "isHeader" in [tags] {
		mutate {
			update => ["header", "%{header}%{message}"]
			update => ["message", " "]
		}
	}
}

```

Please let me know how add\_tag is different from other filters.

Thanks.

---

<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:** [September 22, 2015, 5:39am UTC](https://discuss.elastic.co/t/working-of-add-tag-in-multiline/29733/2 "2015-09-22T05:39:49Z")

</div>

The `add_field` and `add_tag` parameters only take effect if the filter is successful. I don't know exactly what defines success in the multiline case, but I suspect that your use of the filter doesn't count as such.

I don't know what you're trying to do with this series of filters. You may get more relevant help if you explain the bigger issue and supply some example input.

---

<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:28am UTC](https://discuss.elastic.co/t/working-of-add-tag-in-multiline/29733/3 "2017-07-06T05:28:30Z")

</div>


