I'm getting the below JSON as a message:
{
"requestUrl": "http://localhost:8080/frameworks/298",
"requestUri": "/frameworks/298",
"requestMethod": "PUT",
"requestHeaders": {
"authorization": "***",
"accept-language": "en",
"content-type": "application/json"
},
"requestBody": {
"name": "NodeJs"
}
}
Using the below filter my whole JSON gets printed in a field called message in Kibana which is fine. but when I try to extract a specific attribute in the JSON It didn't work.
filter {
json {
source => "message"
}
mutate {
add_field => {
"requestUrl" => "%{[message][requestUrl]}"
"requestUri" => "%{[message][requestUri]}"
"requestMethod" => "%{[message][requestMethod]}"
"requestHeaders" => "%{[message][requestHeaders]}"
"requestBody" => "%{[message][requestBody]}"
}
}
}
All I want is to add a field in Kibana called "requestUrl" and it should contain the requestUrl value in the JSON.