-
Notifications
You must be signed in to change notification settings - Fork 24.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
Wildcard cluster names for cross cluster search #23893
Comments
Do you think there is a reason Kibana needs to know which requests should get the At some point we want to give users more control in this regard, maybe making it an index pattern level setting, but out of the gate I'm thinking Kibana might just add |
I've nearly completed a basic PR for this. However, as I worked on it a number of questions came up for me. 1. Should this support any options like index wildcards do?https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-index.html
Those options do not necessarily make sense in context of cross cluster search. I guess I'm just asking if we want any options. Such as what do we do in the case a wildcard is used but no cluster matches? Which brings to number 2: 2. What do we do if a wildcard is used but no cluster matches?Do we treat that as a local index? Even though a * cannot be in an index name? Do we throw an error? Currently I believe that if a cluster name does not match we treat it as a local index. So "nonexistentcluster:index" would be treated as index on local node: "nonexistentcluster:index". 3. Should this change support + and - wildcard options?Right now for indices we support them. https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-index.html
I guess with cluster names this might look something like:
That obviously can get kind of complicated when you're using both + and - options for both clusters and indices. 4. Do wildcards for cluster names reference the local cluster?So does "*:test" search the local cluster? Or do you need to do "*:test,test". And if it does search the local cluster do we use "cluster.name" as the local cluster name to match against the wildcard? I think this diverges from the remote clusters where we use the alias defined locally opposed to the remote cluster.name setting? |
No, those options applies to the underlying indices (and any wildcard expansion of those)
Same as today, ignore them
No, let's keep this simple
This is tricky... Today, you can define an alias for the local cluster, in which case |
@clintongormley I was looking through the documentation today and was not able to figure out exactly what you're referencing. Are you saying that you would do something like this in the config:
|
@tbrooks8 yes you can do that today, but actually @s1monw wants to remove this and to replace it with a |
This is related to #23893. This commit allows users to use wilcards for cluster names when executing a cross cluster search. So instead of defining every cluster such as: GET one:*,two:*,three:*/_search A user could just search: GET *:*/_search As ":" characters are currently allowed in index names, if the text up to the first ":" does not match a defined cluster name, the entire string is treated as an index name.
This is related to #23893. This commit allows users to use wilcards for cluster names when executing a cross cluster search. So instead of defining every cluster such as: GET one:*,two:*,three:*/_search A user could just search: GET *:*/_search As ":" characters are currently allowed in index names, if the text up to the first ":" does not match a defined cluster name, the entire string is treated as an index name.
Very happy to see this as this was the very first thing I tried to do when 5.3.0 was released and I was testing out the behavior. Look forward to it coming. However I'm confused and trying to understand why Instead it sounds like |
@djschny I can give you the development perspective and then maybe @clintongormley can add anything if he wants. Currently you have to manually define aliases for remote clusters either in the config or with settings requests. Those aliases are are what we use for matching. The problem is that we do not have a predefined alias for the local cluster. So while we could add behavior to always search the local cluster with The current solution is to add the local cluster to your config for cross cluster search. Once you have a defined alias, everything works as it does for any other cluster. Currently, if you have not defined the local cluster for cross cluster search and you want to search both then you do On the other hand, I think that the |
Thanks for the clarification @tbrooks8, I misinterpreted and didn't realize that the adding of localhost in the remote clusters list was more a temporary workaround until the longer term Thanks! |
@tbrooks8 should this issue be closed? |
Closed by #23985 |
With cross cluster search today, each cluster has to be specified separately, eg
It would be good to be able to support wildcards:
By extension, (because it is how it works everywhere else), we should support pattern matching like:
One complication is that
:
is an allowed character in index names today (although we have plans to deprecate #23892). We can work around this with the following logic::
as a cluster nameThe text was updated successfully, but these errors were encountered: