KV not including space values

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

You input is in json format

you can try this

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

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

key1=first value key2=second value key3=value3

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

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",
}

then you can write the grok.

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