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

Improve "put template" error message and documentation of disallowed characters #55606

Closed
hatharom opened this issue Apr 22, 2020 · 6 comments
Closed
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >docs General docs changes >enhancement good first issue low hanging fruit Team:Data Management Meta label for data/management team Team:Docs Meta label for docs team

Comments

@hatharom
Copy link

hatharom commented Apr 22, 2020

Couldn't find anything in the documentation.
The examples are with *.

I have tried with ? - while PUT-ing a template - which was rejected:
"index_patterns": ["test?"]
response:

"reason": "index_template [temp1] invalid, cause [Validation Failed: 1: template must not contain the following characters [ , ", *, \, <, |, ,, >, /, ?];]"

which is interesting because the error message contains the * as well.

How can I define an index pattern for this?: prefix-anyword-number
right now I am doing this: prefix-- , which is terrible imo.

Or is it only supports the asterisk?

@cbuescher cbuescher added :Data Management/Indices APIs APIs to create and manage indices and templates >docs General docs changes labels Apr 30, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Indices APIs)

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Apr 30, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-docs (>docs)

@elasticmachine elasticmachine added the Team:Docs Meta label for docs team label Apr 30, 2020
@cbuescher
Copy link
Member

Hi @hatharom,

you can find the code checking the validity of the index patters in MetaDataIndexTemplateService. Looking at this, the following characters seem to be forbidden:
, ,, #, _ and the ones mentioned in Strings, with the notable exception of the asterisk (see https://github.com/elastic/elasticsearch/blob/7.6/server/src/main/java/org/elasticsearch/common/Strings.java#L389). The error message is indeed misleading here, we should correct that and maybe also document the (dis)allowed characters better.

@cbuescher cbuescher changed the title What kind of wildcards are supported in indexpattern? Improve "put template" error message and documentation of disallowed characters Apr 30, 2020
@cbuescher
Copy link
Member

@hatharom hope you don't mind me changing the subject of this issue, so its clear its not just a usage question. For pure usage questions we generally prefer asking in the support forums over at https://discuss.elastic.co so we can keep Github issues only for bug reports and feature requests, but since the error message is misleading and the index_patterns documentation probably needs updating I think we should keep this open.

@abprash
Copy link
Contributor

abprash commented May 13, 2020

Is someone working on this ? @hatharom , @cbuescher . If not, can i work on this?

@cbuescher
Copy link
Member

@abprash sorry, I think this was adressed by #56170 and this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Indices APIs APIs to create and manage indices and templates >docs General docs changes >enhancement good first issue low hanging fruit Team:Data Management Meta label for data/management team Team:Docs Meta label for docs team
Projects
None yet
Development

No branches or pull requests

5 participants