-
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
[Filebeat] Improve ECS field mappings in aws module #16307
Conversation
Pinging @elastic/siem (Team:SIEM) |
- elb fileset + cloud.provider + event.category + event.kind + event.outcome + http.response.status_code, convert to long + http.request.method, lowercase + tracing.trace.id - s3access fileset + client.address + client.ip + geo + client.user.id + cloud.provider + event.action + event.code + event.duration + event.id + event.kind + event.outcome + http.request.referrer + http.response.status_code + related.user + user_agent - vpcflow fileset + cloud.provider + cloud.account.id + cloud.instance.id + event.kind Closes elastic#16154
468fa77
to
0539c3e
Compare
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.
Great to see the ECS progress.
value: network | ||
|
||
- convert: | ||
field: http.response.status_code |
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.
This can be accomplished in the grok statement by adding :long
like we have in %{NUMBER:http.request.body.bytes:long}
.
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.
In general using the grok should also be safer, because if this fails with ignore_failure
the data won't be indexed because of a mapping exception (assuming the field is mapped as a long).
It probably would never fail to convert here since the grok has it as a NUMBER
, but it's something to keep in mind for other cases.
value: success | ||
|
||
- set: | ||
if: 'ctx?.http?.response?.status_code != null && ctx.http.response.status_code > 399' |
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.
Just a suggestion.
if: 'ctx?.http?.response?.status_code != null && ctx.http.response.status_code > 399' | |
if: 'ctx?.http?.response?.status_code != null && ctx.http.response.status_code >= 400' |
|
||
- set: | ||
if: "ctx?.aws?.s3access?.remote_ip != null" | ||
field: client.ip |
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.
How about related.ip
too?
- improve grok pattern to make status code a long - make status code check more readable - add remote_ip to related.ip
* Improve ECS field mappings in aws module - elb fileset + cloud.provider + event.category + event.kind + event.outcome + http.response.status_code, convert to long + http.request.method, lowercase + tracing.trace.id - s3access fileset + client.address + client.ip + geo + client.user.id + cloud.provider + event.action + event.code + event.duration + event.id + event.kind + event.outcome + http.request.referrer + http.response.status_code + related.ip + related.user + user_agent - vpcflow fileset + cloud.provider + cloud.account.id + cloud.instance.id + event.kind Closes elastic#16154 (cherry picked from commit 913f7ee)
* Improve ECS field mappings in aws module - elb fileset + cloud.provider + event.category + event.kind + event.outcome + http.response.status_code, convert to long + http.request.method, lowercase + tracing.trace.id - s3access fileset + client.address + client.ip + geo + client.user.id + cloud.provider + event.action + event.code + event.duration + event.id + event.kind + event.outcome + http.request.referrer + http.response.status_code + related.ip + related.user + user_agent - vpcflow fileset + cloud.provider + cloud.account.id + cloud.instance.id + event.kind Closes #16154 (cherry picked from commit 913f7ee)
elb fileset
s3access fileset
vpcflow fileset
Closes #16154
What does this PR do?
Why is it important?
Checklist
Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs