Kv filter doubts

Upon filtering the fields in kvs, can if or any other conditional statemnts be used on the keys and values. If so, how?

https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html

Hi Magnus but in the if statements how do you specify the keys/values as a condition

Let say the snippet is "error":"1" , "usrname:"tom" If i pass it across kv fliter i get all these four fields separately. Now i want to specify if the error is 1, then network is down, error is 2 sotware is out dated (just for an example); then how do i use the use if statemnt after writinga a kv filter

There are several examples of just that in the Conditionals section of the page I linked to.

For an enumeration such as your example you can use the translate filter.

if conditions works fine with the most. But if followed by a key , it doesnt work.

can if statments be used in the filter section but outside the mutate section.?

if conditions works fine with the most. But if followed by a key , it doesnt work.

I don't understand what you mean. Please always give examples instead of describing things with words.

can if statments be used in the filter section but outside the mutate section.?

Yes.

I tried to use else statement in filter section. It threwan error.

thanks

error reads as "Coudnt find any plug in named else"

error reads as "Coudnt find any plug in named else"

Then you used the wrong syntax, got your braces mixed up, or something else.

yes i have mixed up with double quotes

Hi Magnus

How do i make a search case insensitive.

For example, The input text is as follows : if statuscode=001 or StatusCode=001, StaTUSCode=001. I have to design a filter that can pick up any combination of statuscode irrrespective of its case.

Wouldn't the kv filter's transform_key option help?

When i used transform_key, i obtained the following error

Unknown setting 'transform_key' for kv {:level=>:error}
Error: Something is wrong with your configuration. {:level=>:error}

You need to upgrade your kv plugin. If your version of Logstash is too old you may have to upgrade Logstash as well.

is there a command to upgade kvplugin and logstash . Is the Upgrading kv plugin is different from upgrading logstash?

The Logstash documentation describes how to upgrade individual plugins.