Is there a way to use KV filter for parse payload patterns as below:
A(1), B(2), C(3), D(T1)
Looked into config-option include_brackets
, trim_key
, trim_value
logstash filter is as below:
filter {
kv {
value_split => "("
trim_key => "\"\ \(\)"
field_split => ","
}
}
rubydebug as below:
elk_logstash | {
elk_logstash | "@version" => "1",
elk_logstash | "message" => "A(1), B(2), C(3), D(T1), E(ttre)",
elk_logstash | "host" => {
elk_logstash | "name" => "3b015b1f625d"
elk_logstash | },
elk_logstash | "offset" => 0,
elk_logstash | "E" => "ttre)",
elk_logstash | "input" => {
elk_logstash | "type" => "log"
elk_logstash | },
elk_logstash | "D" => "T1)",
elk_logstash | "prospector" => {
elk_logstash | "type" => "log"
elk_logstash | },
elk_logstash | "B" => "2)",
elk_logstash | "@timestamp" => 2019-03-31T13:27:56.402Z,
elk_logstash | "A" => "1)",
elk_logstash | "C" => "3)",
elk_logstash | "source" => "/var/log/testfile",
elk_logstash | "beat" => {
elk_logstash | "version" => "6.5.2",
elk_logstash | "hostname" => "3b015b1f625d",
elk_logstash | "name" => "3b015b1f625d"
elk_logstash | },
elk_logstash | "tags" => []
elk_logstash | }