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

[Console] Date Math in Index Names requires URI-encoding #9894

Closed
pickypg opened this issue Jan 16, 2017 · 1 comment
Closed

[Console] Date Math in Index Names requires URI-encoding #9894

pickypg opened this issue Jan 16, 2017 · 1 comment
Labels
bug Fixes for quality problems that affect the customer experience chore Feature:Console Dev Tools Console Feature Feature:Dev Tools

Comments

@pickypg
Copy link
Member

pickypg commented Jan 16, 2017

Attempting to query Elasticsearch using Date math in the index pattern, such as

GET /<logstash-{now/d}>/_search

Results in a weird error:

{
  "error": {
    "root_cause": [
      {
        "type": "index_not_found_exception",
        "reason": "no such index",
        "resource.type": "index_or_alias",
        "resource.id": "<logstash-{now",
        "index_uuid": "_na_",
        "index": "<logstash-{now"
      }
    ],
    "type": "index_not_found_exception",
    "reason": "no such index",
    "resource.type": "index_or_alias",
    "resource.id": "<logstash-{now",
    "index_uuid": "_na_",
    "index": "<logstash-{now"
  },
  "status": 404
}

This is because it needs to be URI-encoded. The real issue is that the inner / needs to be URI-encoded.

GET /%3Clogstash-%7Bnow%2Fd%7D%3E/_search
{
  "query" : {
    "match": {
      "test": "data"
    }
  }
}

For anyone running into this issue that is lazy like me, you can use the functional equivalent without any encoding:

GET /<logstash-{now}>/_search

Because the date format string is going to be 2017-01-16 (or whatever it happens to be today), it doesn't matter if you chopped off the time or not.

@pickypg pickypg added Feature:Console Dev Tools Console Feature bug Fixes for quality problems that affect the customer experience chore labels Jan 16, 2017
@jbudz
Copy link
Member

jbudz commented Oct 5, 2017

Tracking at #8567

@jbudz jbudz closed this as completed Oct 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience chore Feature:Console Dev Tools Console Feature Feature:Dev Tools
Projects
None yet
Development

No branches or pull requests

3 participants