Skip to content

Clarify use of date math in index names with custom date formats #22322

@spinscale

Description

@spinscale

Elasticsearch version: 5.1

You can run this curl command to see that date math calculation with custom formats including more than year, month and day is crippled/bogus.

curl -g -v 'localhost:9200/<logstash-{now%2fd{YYYY.MM.dd.hh.mm.ss}}>'

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

The index name logstash-2016.12.22.12.00.00 does not seem to take minutes and seconds into account and the hour seems to be wrong as well.

The docs dont mention anything, that these formats are not supported - and I am not too sure they should (especially seconds), but this is unexpected behaviour so we should either fix it or document it.

Metadata

Metadata

Assignees

Labels

:Search Foundations/MappingIndex mappings, including merging and defining field types>docsGeneral docs changesTeam:Search FoundationsMeta label for the Search Foundations team in Elasticsearchhelp wantedadoptme

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions