# KV plugin leaves starting bracket in key

**URL:** <https://discuss.elastic.co/t/kv-plugin-leaves-starting-bracket-in-key/125698>\
**Category:** Logstash\
**Created:** [March 27, 2018, 6:41am UTC](https://discuss.elastic.co/t/kv-plugin-leaves-starting-bracket-in-key/125698 "2018-03-27T06:41:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![reilee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/reilee/32/25745_2.png) [@reilee](https://discuss.elastic.co/u/reilee)\
**Post date:** [March 27, 2018, 6:41am UTC](https://discuss.elastic.co/t/kv-plugin-leaves-starting-bracket-in-key/125698/1 "2018-03-27T06:41:22Z")

</div>

Just found a difference after upgrade logstash to v6.2.3.

sample data:

```auto
{{key1=value1}{key2=value2}}
```

config:

```auto
kv {
  field_split => "\{\}"
}
```

expected output:

```auto
key1 => value1
key2 => value2
```

But after upgrade, it outputs like:

```auto
{key1 => value1
{key2 => value2
```

Tested on standalone logstash v6.2.2, it works fine as expected.  
kv plugin version in logstash 6.2.2 is 4.0.3  
in logstash 6.2.3 it is 4.1.0

Currently I am using `remove_char_key => "{"` as a workaround.

---

<div class="post-metadata">

**Author:** ![reilee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/reilee/32/25745_2.png) [@reilee](https://discuss.elastic.co/u/reilee)\
**Post date:** [March 27, 2018, 7:20am UTC](https://discuss.elastic.co/t/kv-plugin-leaves-starting-bracket-in-key/125698/2 "2018-03-27T07:20:22Z")

</div>

Even update kv plugin version to v4.1.1 (latest) doesn't help.

---

<div class="post-metadata">

**Author:** ![Mojster](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mojster/32/21209_2.png) [@Mojster](https://discuss.elastic.co/u/Mojster)\
**Post date:** [March 27, 2018, 7:57am UTC](https://discuss.elastic.co/t/kv-plugin-leaves-starting-bracket-in-key/125698/3 "2018-03-27T07:57:29Z")

</div>

Have you tried the new regex option? This was added in 4.1.0.  
It should be able to get this right:  
[https://www.elastic.co/guide/en/logstash/current/plugins-filters-kv.html#plugins-filters-kv-field\_split\_pattern](https://www.elastic.co/guide/en/logstash/current/plugins-filters-kv.html#plugins-filters-kv-field_split_pattern)

---

<div class="post-metadata">

**Author:** ![reilee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/reilee/32/25745_2.png) [@reilee](https://discuss.elastic.co/u/reilee)\
**Post date:** [March 27, 2018, 8:14am UTC](https://discuss.elastic.co/t/kv-plugin-leaves-starting-bracket-in-key/125698/4 "2018-03-27T08:14:33Z")

</div>

Hi @Mojster thank you for suggestion.  
I've tried on logstash v6.2.3 w/ kv plugin v4.1.1 like following:

```auto
kv {
  field_split_pattern => "[\{+\}+]"
}
```

But it still cannot remove the start bracket.

---

<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 24, 2018, 8:14am UTC](https://discuss.elastic.co/t/kv-plugin-leaves-starting-bracket-in-key/125698/5 "2018-04-24T08:14:40Z")

</div>

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