Hope this is not a repeat.
I have a document like following in json format.
{ "request_body": "", "bytes_sent": 16, "response_body": "", "response_http_headers": [ { "Content-Type": "application/json" }, { "Date": "Thu, 05 Mar 2020 19:17:35 GMT" }, { "Content-Length": "459" }, { "Via": "1.1 AgAAANE7P4c-" }, { "hostname": "myhost.com" }, { "msgid": "414d51205343535131202020202020205e56fb652147c3b6" }, { "Access-Control-Allow-Origin": "*" }, { "Access-Control-Allow-Methods": "POST" }, { "X-RateLimit-Limit": "name=default,10000;" }, { "X-RateLimit-Remaining": "name=default,9996;" } ], "@timestamp": "2020-03-05T19:17:33.962Z" }
so in my logstash config i have
if "myhost.com" in [response_http_headers]
{
mutate{
add_field => { "Raj" => "found myhost" }
}
}
but it does not detect
any clue on what am i doing wrong ? or what i m trying thats not possible ?
Raj