# KV not including space values

**URL:** <https://discuss.elastic.co/t/kv-not-including-space-values/119205>\
**Category:** Logstash\
**Created:** [February 9, 2018, 9:52am UTC](https://discuss.elastic.co/t/kv-not-including-space-values/119205 "2018-02-09T09:52:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tag\_v](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tag_v/32/47466_2.png) [@tag\_v](https://discuss.elastic.co/u/tag_v)\
**Post date:** [February 9, 2018, 9:52am UTC](https://discuss.elastic.co/t/kv-not-including-space-values/119205/1 "2018-02-09T09:52:11Z")

</div>

input message:  
key1=first value key2=second value key3=value3

required output:  
{  
"key1" =\> "first value",  
"key2" =\> "second value",  
"key3" =\> "value3",  
"message" =\> "key1=first value key2=second value key3=value3"  
}

obtained outpu:  
{  
"key1" =\> "first",  
"key2" =\> "second",  
"key3" =\> "value3",  
"message" =\> "key1=first value key2=second value key3=value3"  
}

I need space values to be included in field. How to do this in logstash? ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/5/85fc5c3898f6c7e70a5627714da582e6c2412054.png)

---

<div class="post-metadata">

**Author:** ![Krunal\_kalaria](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krunal_kalaria/32/23862_2.png) [@Krunal\_kalaria](https://discuss.elastic.co/u/Krunal_kalaria)\
**Post date:** [February 9, 2018, 10:26am UTC](https://discuss.elastic.co/t/kv-not-including-space-values/119205/2 "2018-02-09T10:26:11Z")

</div>

You input is in json format

you can try this

filter  
{  
json  
{  
source =\> "message"  
}  
}

---

<div class="post-metadata">

**Author:** ![tag\_v](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tag_v/32/47466_2.png) [@tag\_v](https://discuss.elastic.co/u/tag_v)\
**Post date:** [February 9, 2018, 10:28am UTC](https://discuss.elastic.co/t/kv-not-including-space-values/119205/3 "2018-02-09T10:28:06Z")

</div>

My log format is not in json.  
This is my input message in key value pair :

key1=first value key2=second value key3=value3

---

<div class="post-metadata">

**Author:** ![Krunal\_kalaria](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krunal_kalaria/32/23862_2.png) [@Krunal\_kalaria](https://discuss.elastic.co/u/Krunal_kalaria)\
**Post date:** [February 9, 2018, 10:31am UTC](https://discuss.elastic.co/t/kv-not-including-space-values/119205/4 "2018-02-09T10:31:15Z")

</div>

your input is same mean field is same and only its value is changed right ?

---

<div class="post-metadata">

**Author:** ![tag\_v](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tag_v/32/47466_2.png) [@tag\_v](https://discuss.elastic.co/u/tag_v)\
**Post date:** [February 9, 2018, 10:35am UTC](https://discuss.elastic.co/t/kv-not-including-space-values/119205/5 "2018-02-09T10:35:56Z")

</div>

my fieldnames are different in log. i need values with spaces to be included to field name.

ie:  
input  
key1 = first value key2 = value2  
should return  
{  
"key1" =\> "first value",  
"key2" =\> "value2",  
}

but in logstash output values after spaces are not included.

my logstash output:  
{  
"key1" =\> "first",  
"key2" =\> "value2",  
}

---

<div class="post-metadata">

**Author:** ![Krunal\_kalaria](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/krunal_kalaria/32/23862_2.png) [@Krunal\_kalaria](https://discuss.elastic.co/u/Krunal_kalaria)\
**Post date:** [February 9, 2018, 10:53am UTC](https://discuss.elastic.co/t/kv-not-including-space-values/119205/6 "2018-02-09T10:53:18Z")

</div>

then you can write the grok.

---

<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:** [March 9, 2018, 10:53am UTC](https://discuss.elastic.co/t/kv-not-including-space-values/119205/7 "2018-03-09T10:53:28Z")

</div>

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