-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export http payload #2167
Export http payload #2167
Conversation
ecdb713
to
4869f69
Compare
05b2850
to
f8d45c4
Compare
We should mention the new |
|
||
Example configuration: | ||
In addition, `http.request.body` and `http.response.body` is exported for all HTTP messages whose content type is part |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/is exported/are exported
4e309d8
to
2d49aa5
Compare
All the comments were addressed. |
a434c79
to
4909eab
Compare
The PR is ready for the final review. I added more tests to cover more use cases. |
I added a test with a wrong Content-Type value. The POST request generated by Console/Sense/curl contains |
7fa977e
to
2de53f2
Compare
|
||
assert len(o["http.response.headers"]) > 0 | ||
assert "Content-Length" in o["http.response.headers"] | ||
assert "Content-Type" in o["http.response.headers"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you intend to check more headers here? Like this it's identical to the test above it.
….body if include_body_for is set.
dab0d29
to
f3d4490
Compare
* Fix the examples from the docs * Update the fields as they are named in #2167 * A few more field names updates
This PR is trying to solve #2143
With this change, the user doesn't need to export the raw request and response in order to index in Elasticsearch the HTTP body. With this PR, the user can specify a list of contact types in the
include_body_for
configuration option, and export for those HTTP requests/responses the HTTP body underhttp.request.body
orhttp.response.body
.The PR includes the following changes in the
http
module of Packetbeat:http.request
andhttp.response
are createdheaders
tohttp.request
andhttp.response
. Ifsend_all_headers
is enabled, then all HTTP headers are exported, if it's disabled then only theContent-Type
(if it's not empty) andContent-Length
are exported.body
to thehttp.request
orhttp.response
if the content-type is part of theinclude_body_for
configuration option.params
underhttp.request
code
andphrase
underhttp.response
Here is how an HTTP event looks like:
NOTE: the Packetbeat dashboards need to be updated in a separate PR