How can i handle nil values in logstash


#1

I am using csv as input as shown below

firstname lastname

dinesh angari
rajesh
mahesh rangu

and i am using http as output and below is my filter

mutate {add_field => {"newlastname" => "%{lastname}"} }

but in the output when the lastname value is null i am getting %{lastname} value as newlastname

please help me how can i ignore null values.

Thanks in advance............................


(Pier-Hugues Pellerin) #2

You can wrap the plugin with a conditional like this to check for existence.

if [lastname] {
mutate {add_field => {"newlastname" => "%{lastname}"} }
}

(system) #3

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