Working of add tag in multiline


(Vilas Reddy Podduturi) #1

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:

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.


(Magnus B├Ąck) #2

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.


(system) #3