I'm sending json formatted logs messages to datadog:
"Headers": {
"Content-Type": [
"application/json"
]
},
"Method": "POST",
"Body": "{\"test\": 1234, \"test2\": {\"test3\": 1245}}",
"URL": "https://test",
"Host": "test",
"UserAgent": ""
}
The issue is with the field Body. I want datadog to pick this up as json so it's parsed. So I'm looking into log pipelines and in particular the grok processor to preprocess the log message and unescape the Body field.
%{data::json} as a parsing rule works but doesn't unescape Body. I tried stuff like: %{data::json{source => "Body" target => "Body"}} but datadog marks the rule as invalid.
- Is there a better way to achieve the unescaping in datadog?
- How can I create a valid grok rule for datadog that unescapes the Body field?