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

add data_stream_template_use_index_patterns_wildcard in elasticsearch_data_stream #1040

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

bgruszka
Copy link
Contributor

@bgruszka bgruszka commented Dec 6, 2023

Add data_stream_template_use_index_patterns_wildcard config param in elasticsearch_data_stream

Specify whether index patterns should include a wildcard (*) when creating an index template. This is particularly useful to prevent errors in scenarios where index templates are generated automatically, and multiple services with distinct suffixes are in use.

Default value is true.

Consider the following JSON error response when index patterns clash due to wildcard usage:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "index template [eks-kube-apiserver] has index patterns [eks-kube-apiserver*] matching patterns from existing templates [eks-kube-apiserver-audit] with patterns (eks-kube-apiserver-audit => [eks-kube-apiserver-audit*]) that have the same priority [0], multiple index templates may not match during index creation, please use a different priority"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "index template [eks-kube-apiserver] has index patterns [eks-kube-apiserver*] matching patterns from existing templates [eks-kube-apiserver-audit] with patterns (eks-kube-apiserver-audit => [eks-kube-apiserver-audit*]) that have the same priority [0], multiple index templates may not match during index creation, please use a different priority"
  },
  "status": 400
}

Usage Examples

When data_stream_template_use_index_patterns_wildcard is set to true (default):

data_stream_name: foo
data_stream_template_use_index_patterns_wildcard: true

In this case, the resulting index patterns will be: ["foo*"]

When data_stream_template_use_index_patterns_wildcard is set to false:

data_stream_name: foo
data_stream_template_use_index_patterns_wildcard: false

The resulting index patterns will be: ["foo"]

(check all that apply)

  • tests added
  • tests passing
  • README updated (if needed)
  • README Table of Contents updated (if needed)
  • History.md and version in gemspec are untouched
  • backward compatible
  • feature works in elasticsearch_dynamic (not required but recommended)

#1)

add data_stream_template_use_index_patterns_wildcard config param in elasticsearch_data_stream
Copy link
Collaborator

@cosmo0920 cosmo0920 left a comment

Choose a reason for hiding this comment

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

I read your patch and understand that this PR is useful for some of the use cases.
And thank you for adding the documentation. It's quite useful for users 😄

@cosmo0920 cosmo0920 merged commit 14f5eed into uken:master Dec 12, 2023
9 checks passed
@bgruszka
Copy link
Contributor Author

@cosmo0920 thank you :) can you release a new tag and new gem version? :)

@cosmo0920
Copy link
Collaborator

@kenhys Do you have a cycle to handle this?

@bgruszka
Copy link
Contributor Author

bgruszka commented Jan 2, 2024

@cosmo0920 @kenhys ping :)

@bgruszka
Copy link
Contributor Author

bgruszka commented Jan 4, 2024

@cosmo0920 @kenhys Can someone release this? We really need it in our company, but unfortunately, I don't have the necessary permissions. If I had them, I would have already taken care of it...

@bgruszka
Copy link
Contributor Author

ping

@cosmo0920
Copy link
Collaborator

This patch is released as v5.4.3. Sorry for delaying to publish.

@bgruszka
Copy link
Contributor Author

thank you 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants