# Trimming of whitespace from kv filter fields unexpected

**URL:** <https://discuss.elastic.co/t/trimming-of-whitespace-from-kv-filter-fields-unexpected/123643>\
**Category:** Logstash\
**Created:** [March 12, 2018, 9:18pm UTC](https://discuss.elastic.co/t/trimming-of-whitespace-from-kv-filter-fields-unexpected/123643 "2018-03-12T21:18:58Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [March 12, 2018, 9:18pm UTC](https://discuss.elastic.co/t/trimming-of-whitespace-from-kv-filter-fields-unexpected/123643/1 "2018-03-12T21:18:58Z")

</div>

Is there anything in the [documentation for the kv filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-kv.html) that suggests the following config

```
input { generator { message => 'TLSID: d8658382-91d6-45f4-9b36-ab9893b5e185|Content-Length: 395|Content-Type: application/json' count => 1 } }
output { stdout { codec => rubydebug } }
filter {
  kv {
    field_split => "|"
    value_split => ":"
  }
}
```

would generate this (with optional\_whitespace trimmed from the beginning of each value)

```
"Content-Type" => "application/json",
             "TLSID" => "d8658382-91d6-45f4-9b36-ab9893b5e185",
           "message" => "TLSID: d8658382-91d6-45f4-9b36-ab9893b5e185|Content-Length: 395|Content-Type: application/json",
    "Content-Length" => "395"
```
I was expecting to have to set trim\_value

---

<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 9, 2018, 9:18pm UTC](https://discuss.elastic.co/t/trimming-of-whitespace-from-kv-filter-fields-unexpected/123643/2 "2018-04-09T21:18:59Z")

</div>

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