How to split separate field on nested JSON Array.
Can someone kindly help with this? Thank you.
Below is the nested JSON array
Sample JSON Code
"http": {
"request": {
"headers": [
{
"Name": "Host",
"Value": "example.com"
},
{
"Name": "Connection",
"Value": "keep-alive"
}
]
}
}
Sample My Code
split {
field => "[http][request][headers]"
}
mutate {
add_field => {
"[http][request][headers][%{[http][request][headers][Name]}]" => "%{[http][request][headers][Value]}"
}
remove_field => [
"[http][request][headers][Name]",
"[http][request][headers][Value]"
]
}
After the code output is getting only one field