# Urldecode on kv results

**URL:** https://discuss.elastic.co/t/urldecode-on-kv-results/78155
**Category:** Logstash
**Created:** [March 10, 2017, 2:22pm UTC](https://discuss.elastic.co/t/urldecode-on-kv-results/78155 "2017-03-10T14:22:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![andre22](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@andre22](https://discuss.elastic.co/u/andre22)
#### Post date: [March 10, 2017, 2:22pm UTC](https://discuss.elastic.co/t/urldecode-on-kv-results/78155/1 "2017-03-10T14:22:05Z")

</div>

Hi,

as hinted [here](https://discuss.elastic.co/t/newbie-question-different-numbers-of-url-parameters/77978/2) 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!

---

<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: [March 10, 2017, 2:29pm UTC](https://discuss.elastic.co/t/urldecode-on-kv-results/78155/2 "2017-03-10T14:29:18Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![andre22](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@andre22](https://discuss.elastic.co/u/andre22)
#### Post date: [March 10, 2017, 2:38pm UTC](https://discuss.elastic.co/t/urldecode-on-kv-results/78155/3 "2017-03-10T14:38:26Z")

</div>

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 { 
 ....
   }
}
```

---

<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: [March 10, 2017, 2:39pm UTC](https://discuss.elastic.co/t/urldecode-on-kv-results/78155/4 "2017-03-10T14:39:59Z")

</div>

> 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.

---

<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: [April 7, 2017, 2:40pm UTC](https://discuss.elastic.co/t/urldecode-on-kv-results/78155/5 "2017-04-07T14:40:00Z")

</div>

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