Skip to content
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 categorization field mappings for nginx module #17844

Merged
merged 2 commits into from
Apr 23, 2020

Conversation

leehinman
Copy link
Contributor

@leehinman leehinman commented Apr 20, 2020

What does this PR do?

Improves ECS categorization field mappings for nginx module. Specifically it adds:

  • access
    • event.kind
    • event.category
    • event.type
    • event.outcome
    • lowercase http.request.method
    • improve grok to not populate empty fields
    • related.ip
    • related.users
  • error
    • event.kind
    • event.category
    • event.outcome
  • ingress_controller
    • event.kind
    • event.category
    • event.type
    • event.outcome
    • lowercase http.request.method
    • improve grok to not populate empty fields
    • related.ip
    • related.users

Why is it important?

Improved ECS compliance improves use in SIEM application and makes comparing data across data sources easier.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

Closes #16174

@leehinman leehinman added enhancement Filebeat Filebeat needs_backport PR is waiting to be backported to other branches. Team:SIEM ecs labels Apr 20, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

- access
  + event.kind
  + event.category
  + event.type
  + event.outcome
  + lowercase http.request.method
  + improve grok to not populate empty fields
  + related.ip
  + related.users
- error
  + event.kind
  + event.category
  + event.outcome
- ingress_controller
  + event.kind
  + event.category
  + event.type
  + event.outcome
  + lowercase http.request.method
  + improve grok to not populate empty fields
  + related.ip
  + related.users

Closes elastic#16174
Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice PR description listing the exact changes BTW.

@leehinman leehinman merged commit 93c3d15 into elastic:master Apr 23, 2020
@leehinman leehinman deleted the 16174_nginx_ecs_1.4 branch April 23, 2020 14:10
@leehinman leehinman added v7.8.0 and removed needs_backport PR is waiting to be backported to other branches. labels Apr 23, 2020
leehinman added a commit to leehinman/beats that referenced this pull request Apr 23, 2020
…7844)

- access
  + event.kind
  + event.category
  + event.type
  + event.outcome
  + lowercase http.request.method
  + improve grok to not populate empty fields
  + related.ip
  + related.users
- error
  + event.kind
  + event.category
  + event.outcome
- ingress_controller
  + event.kind
  + event.category
  + event.type
  + event.outcome
  + lowercase http.request.method
  + improve grok to not populate empty fields
  + related.ip
  + related.users

Closes elastic#16174

(cherry picked from commit 93c3d15)
Comment on lines -9 to +17
"http.request.method": "GET",
"http.request.referrer": "-",
"http.request.method": "get",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a breaking change? GET is now lowercased, also referrer is now missing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with marking this as a breaking change.

Some background.
http.request.referrer is an ECS field and docs say "The field value must be normalized to lowercase for querying." So that is why the change to lowercase.

http.request.referrer isn't missing, the GROK pattern was changed so it is only filled in when nginx logs a referrer an actual referrer. "-" is the same as not present.

leehinman added a commit to leehinman/beats that referenced this pull request Apr 27, 2020
PR elastic#17844 introduced the following changes:

- http.request.method is now lowercase
- http.request.referrer is only set when nginx provides a value

This PR updates the CHANGELOG to report this as a breaking change.
leehinman added a commit that referenced this pull request Apr 29, 2020
…17940)

- access
  + event.kind
  + event.category
  + event.type
  + event.outcome
  + lowercase http.request.method
  + improve grok to not populate empty fields
  + related.ip
  + related.users
- error
  + event.kind
  + event.category
  + event.outcome
- ingress_controller
  + event.kind
  + event.category
  + event.type
  + event.outcome
  + lowercase http.request.method
  + improve grok to not populate empty fields
  + related.ip
  + related.users

Closes #16174

(cherry picked from commit 93c3d15)
leehinman added a commit that referenced this pull request Apr 29, 2020
PR #17844 introduced the following changes:

- http.request.method is now lowercase
- http.request.referrer is only set when nginx provides a value

This PR updates the CHANGELOG to report this as a breaking change.
leehinman added a commit to leehinman/beats that referenced this pull request Apr 29, 2020
…#18026)

PR elastic#17844 introduced the following changes:

- http.request.method is now lowercase
- http.request.referrer is only set when nginx provides a value

This PR updates the CHANGELOG to report this as a breaking change.

(cherry picked from commit 0de9b67)
leehinman added a commit that referenced this pull request May 4, 2020
…#18113)

PR #17844 introduced the following changes:

- http.request.method is now lowercase
- http.request.referrer is only set when nginx provides a value

This PR updates the CHANGELOG to report this as a breaking change.

(cherry picked from commit 0de9b67)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Filebeat] Upgrade nginx module to ECS 1.4
4 participants