# What filter i need?

**URL:** https://discuss.elastic.co/t/what-filter-i-need/176954
**Category:** Logstash
**Created:** [April 15, 2019, 6:29pm UTC](https://discuss.elastic.co/t/what-filter-i-need/176954 "2019-04-15T18:29:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![OlegInishev](https://avatars.discourse-cdn.com/v4/letter/o/b782af/32.png) [@OlegInishev](https://discuss.elastic.co/u/OlegInishev)
#### Post date: [April 15, 2019, 6:29pm UTC](https://discuss.elastic.co/t/what-filter-i-need/176954/1 "2019-04-15T18:29:52Z")

</div>

Hi evryone! I have next log example

[time\_field] key1=val1 key2=val2 key3=val3 ACTION\_TYPE key4=val4 key5=val5

I want cut ACTION\_TYPE from message and add him in new field, and then use KV-filter for key-value.  
I use KV because keys sometimes change position.

How i can do this?

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [April 15, 2019, 7:22pm UTC](https://discuss.elastic.co/t/what-filter-i-need/176954/2 "2019-04-15T19:22:30Z")

</div>

You need to provide more information. If the time field is always surrounded by square brackets it is easy to dissect that out and then mutate+gsub it away.

What identifies ACTION\_TYPE? Is it always the fourth field after the [time\_field]. We need to know how to find it.

Are the values in the key value pairs ever blank?

---

<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: [May 13, 2019, 7:22pm UTC](https://discuss.elastic.co/t/what-filter-i-need/176954/3 "2019-05-13T19:22:33Z")

</div>

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