logstash-plugins / logstash-filter-http

HTTP Filter Plugin for Logstash
Apache License 2.0
12 stars 29 forks source link

Feat: improve ECS compatibility #35

Closed kares closed 2 years ago

kares commented 2 years ago

Plugin uses target_body => '[body]' and target_headers => '[headers]' in legacy mode, these were updated to:

~~However there's one TODO left - suppose the returned response body is { "foo": "bar" } with the application/json header. The plugin detects the JSON format and parses the body before setting the content into target_body and thus ends up with: event.get '[http][request][body][content][foo]' => "bar"~~

kares commented 2 years ago

target_body is now required in ECS mode, target_headers still defaults to [@metadata][filter][http][response][headers] in ECS mode.

my logic is that when there's a response header to extract users configuring target_headers => [foo] (anything that isn't meta-data) will copy the relevant parts elsewhere and drop the [foo]field (dropping all irrelevant response headers one by one is not feasible), thus having a @metadata default target would make sense?

kares commented 2 years ago

rebased due changes on main which lead to conflicts ...