Urldecode on kv results

Hi,

as hinted here I am dividing URI query parameters into multiple fields. Is there a way to run urldecode against the resulting fields without naming them specifically in the config?

EDIT: this is the section from my config:

  kv {
    source => "uri-query"
    transform_key => "lowercase"
    recursive => "true"
    field_split => "&?"
    }

thank you!

Have a look at the urldecode filter. I suspect you don't want to urldecode all fields (using its all_fields option) but if you can store the kv-extracted fields in a subfield you can point urldecode to that field and it should decode them all. If you want the fields at the top level rather than in a subfield you can use a ruby filter to move them.

Alternatively, use a ruby filter for the urldecode operation too. Then you can just loop over all fields and selectively urldecode them.

Thank you Magnus.

The urldecode works well for me on individual fields. I guess this is getting a more generic question: would it be possible to include field names via wildcard? like fname1, fname2, fname3, as fname* ?

Or, could I cascade filters, like this?

kv { 
....
   urldecode { 
 ....
   }
}

I guess this is getting a more generic question: would it be possible to include field names via wildcard? like fname1, fname2, fname3, as fname* ?

I think a few filters support this but it doesn't work generally, no.

Or, could I cascade filters, like this?

No, sorry.

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