KV not including space values


(Tag V) #1

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


(Krunal Kalaria) #2

You input is in json format

you can try this

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


(Tag V) #3

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

key1=first value key2=second value key3=value3


(Krunal Kalaria) #4

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


(Tag V) #5

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


(Krunal Kalaria) #6

then you can write the grok.


(system) #7

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