# Parse KV:s beginning with a \<XXX\>key=value

**URL:** https://discuss.elastic.co/t/parse-kv-s-beginning-with-a-xxx-key-value/257055
**Category:** Logstash
**Created:** [November 30, 2020, 11:54am UTC](https://discuss.elastic.co/t/parse-kv-s-beginning-with-a-xxx-key-value/257055 "2020-11-30T11:54:47Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Elitlogik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elitlogik/32/78920_2.png) [@Elitlogik](https://discuss.elastic.co/u/Elitlogik)
#### Post date: [November 30, 2020, 11:54am UTC](https://discuss.elastic.co/t/parse-kv-s-beginning-with-a-xxx-key-value/257055/1 "2020-11-30T11:54:47Z")

</div>

Is there a way to easily remove the leading in a key-value sequence?

`<XXX>key1=value1 key2=value2 key3=value3`

Filter looks like this now:

`filter { kv {} }`

Thank you for your support!

---

<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: [November 30, 2020, 3:45pm UTC](https://discuss.elastic.co/t/parse-kv-s-beginning-with-a-xxx-key-value/257055/2 "2020-11-30T15:45:36Z")

</div>

You can do it with mutate

```
mutate { gsub => ["message", "^<\d+>", ""] }
```

---

<div class="post-metadata">

### Author: ![Elitlogik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elitlogik/32/78920_2.png) [@Elitlogik](https://discuss.elastic.co/u/Elitlogik)
#### Post date: [November 30, 2020, 10:14pm UTC](https://discuss.elastic.co/t/parse-kv-s-beginning-with-a-xxx-key-value/257055/3 "2020-11-30T22:14:52Z")

</div>

> [@Badger](#):
>
> `mutate { gsub => ["message", "^<\d+>", ""] }`

Thank you very much for the solution! You also learned me how the filter is working.

---

<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: [December 28, 2020, 10:15pm UTC](https://discuss.elastic.co/t/parse-kv-s-beginning-with-a-xxx-key-value/257055/4 "2020-12-28T22:15:28Z")

</div>

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