I have next input in logstash
{
logstash | "sourceRecordPosition" => 11,
logstash | "rejectionReason" => "",
logstash | "key" => 2251799813685255,
logstash | "brokerVersion" => "0.26.0",
logstash | "value" => {
logstash | "workflowInstanceKey" => 2251799813685254,
logstash | "scopeKey" => 2251799813685254,
logstash | "value" => "\"fire\"",
logstash | "name" => "emergencyReason",
logstash | "workflowKey" => 2251799813685249
logstash | },
logstash | "valueType" => "VARIABLE",
logstash | "rejectionType" => "NULL_VAL",
logstash | "position" => 12,
logstash | "partitionId" => 1,
logstash | "recordType" => "EVENT",
logstash | "@version" => "1",
logstash | "@timestamp" => 2021-03-24T09:50:13.570Z,
logstash | "intent" => "CREATED"
logstash | }
And I wrote grok filter with regex ( regex101: build, test, and debug regex ) for extract value by group,
filter {
json {
source => "message"
}
if [value][value] =~ /^"\\"(\S+)\\""/ {
mutate {
gsub => [ "[value][value]", '^"\\"(\S+)\\""', "\1" ]
}
}
}
But this not work for me. How can I extract value?