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

Auto-follow all indices with CCR except for system indices #67686

Closed
sachin-frayne opened this issue Jan 19, 2021 · 3 comments
Closed

Auto-follow all indices with CCR except for system indices #67686

sachin-frayne opened this issue Jan 19, 2021 · 3 comments
Labels
:Distributed/CCR Issues around the Cross Cluster State Replication features Team:Distributed Meta label for distributed team

Comments

@sachin-frayne
Copy link
Contributor

I would like to be able to follow any new index created in my leader cluster except for system indices. I assumed *,-.* would work but I get a message pop up saying,

Index name examples
The above settings will generate index names that look like this:
2021-01-19,-.2021-01-19
2021-01-20,-.2021-01-20
2021-01-21,-.2021-01-21

This implies that the index name will have ,-. inside the actual index name. I have also tested this in 7.10.1 and can confirm that this does not in fact match any of my indices (e.g. a-index, 1-index, and so on). As a workaround, I can create an auto-follow pattern for every alphanumeric character, but this is not ideal

PUT /_ccr/auto_follow/a
{
  "remote_cluster": "<remote_cluster>",
  "leader_index_patterns": [
    "a*"
  ],
  "follow_index_pattern": "{{leader_index}}"
}

PUT /_ccr/auto_follow/A
{
  "remote_cluster": "<remote_cluster>",
  "leader_index_patterns": [
    "A*"
  ],
  "follow_index_pattern": "{{leader_index}}"
}

PUT /_ccr/auto_follow/0
{
  "remote_cluster": "<remote_cluster>",
  "leader_index_patterns": [
    "0*"
  ],
  "follow_index_pattern": "{{leader_index}}"
}
@sachin-frayne sachin-frayne added >enhancement needs:triage Requires assignment of a team area label labels Jan 19, 2021
@dnhatn dnhatn added :Distributed/CCR Issues around the Cross Cluster State Replication features and removed >enhancement needs:triage Requires assignment of a team area label labels Jan 19, 2021
@elasticmachine elasticmachine added the Team:Distributed Meta label for distributed team label Jan 19, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@henningandersen
Copy link
Contributor

There are really two parts here:

  1. Not auto-following system indices. It seems like a bug that we allow this.
  2. Exclusion pattern. We should add this as a separate field to the auto-follow request.

Both parts seems reasonable to add.

About the workaround, you could add just one auto follow pattern with the full list of single character patterns (still tedious for sure, but one pattern is easier to manage than many).

fcofdez added a commit that referenced this issue Jun 4, 2021
This commit adds the ability to specify exclusion patterns in Auto-Follow patterns. This allows excluding indices that match any of the inclusion patterns and also match some of the exclusion patterns giving more fine grained control in scenarios where this is important.

Related #67686
fcofdez added a commit to fcofdez/elasticsearch that referenced this issue Jun 4, 2021
This commit adds the ability to specify exclusion patterns in Auto-Follow patterns.
This allows excluding indices that match any of the inclusion patterns and also match
some of the exclusion patterns giving more fine grained control in scenarios where this is important.

Related elastic#67686
Backport of elastic#72935
fcofdez added a commit that referenced this issue Jun 4, 2021
This commit adds the ability to specify exclusion patterns in Auto-Follow patterns.
This allows excluding indices that match any of the inclusion patterns and also match
some of the exclusion patterns giving more fine grained control in scenarios where this is important.

Related #67686
Backport of #72935
@fcofdez
Copy link
Contributor

fcofdez commented Jul 9, 2021

Closed via #72935 and #72815

@fcofdez fcofdez closed this as completed Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/CCR Issues around the Cross Cluster State Replication features Team:Distributed Meta label for distributed team
Projects
None yet
Development

No branches or pull requests

5 participants