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

Cherry-pick #16081 to 7.x: Elasticsearch index must be lowercase #16142

Merged
merged 2 commits into from
Feb 7, 2020

Conversation

urso
Copy link

@urso urso commented Feb 6, 2020

Cherry-pick of PR #16081 to 7.x branch. Original message:

  • Bug

What does this PR do?

This change ensure that index names are always converted to lowercase.
Static strings are converted to lowercase upfront, while dynamic strings
will be post-processed.

Why is it important?

When indexing into Elasticsearch index names must always be lowercase.
If the index or indices setting are configured to produce non-lowercase
strings (e.g. by extracting part of the index name from the event
contents), we need to normalize them to be lowercase.

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

Author's Checklist

  • [ ]

How to test this PR locally

Index with different index/indices configurations into Elasticsearch:

  • use upper case in index setting
  • extract index name from event, that has the field value as upper case string
  • configure a mapping via indices where the target index is upper case

Run same checks with Redis, Kafka, Logstash outputs (the index name should consistently be lower case for all outputs).

Related issues

Use cases

Screenshots

Logs

* Index names must be lowercase

When indexing into Elasticsearch index names must always be lowercase.
If the index or indices setting are configured to produce non-lowercase
strings (e.g. by extracting part of the index name from the event
contents), we need to normalize them to be lowercase.

This change ensure that index names are always converted to lowercase.
Static strings are converted to lowercase upfront, while dynamic strings
will be post-processed.

* update kafka/redis/LS output to guarantee lowercase index
* add godoc

(cherry picked from commit 7ddcb1e)
@urso urso requested a review from a team February 6, 2020 17:57
@urso urso added the Team:Beats label Feb 6, 2020
@@ -71,6 +71,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fix issue where default go logger is not discarded when either * or stdout is selected. {issue}10251[10251] {pull}15708[15708]
- Fix issue where TLS settings would be ignored when a forward proxy was in use. {pull}15516{15516}
- Remove superfluous use of number_of_routing_shards setting from the default template. {pull}16038[16038]
- Upgrade go-ucfg to latest v0.8.1. {pull}15937{15937}
Copy link
Contributor

Choose a reason for hiding this comment

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

This entry does not belong here.

Copy link
Author

Choose a reason for hiding this comment

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

fixed.

@urso urso merged commit bb1319c into elastic:7.x Feb 7, 2020
@urso urso deleted the backport_16081_7.x branch February 7, 2020 15:54
@andresrc andresrc added the Team:Integrations Label for the Integrations team label Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport review Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants