I have this nested JSON:
"jsonPayload": {
"message": "\"id2\":{\"timestamp\":\"2026-01-19 03:15:20\", \"app_name\": \"test1234\", \"client_port\": \"2233\", \"client_host\": \"hostName\"},
}I wrote this code snippet but it doesn't work, can you tell me why?
filter {
mutate {
replace => {
"client_port" => ""
}
}
grok {
match => {
"jsonPayload.message" => ["client_port=(?P<client_port>[0-9]+)"]
}
overwrite => ["client_port"]
on_error => "client_port_not_present"
}
statedump{}
mutate {
rename => {
"client_port" => "event.idm.read_only_udm.principal.port"
}
}
mutate {
convert => {
"event.idm.read_only_udm.principal.port" => "integer"
}
}
mutate {
merge => {
"@output" => "event"
}
}
}
I want to extract the value of the client_port field and map it to the UDM principal.port field
Thanks in advance for your support.