What are the rules for index names in Elastic Search?

If you try to create an index with a name whose length exceeds 255 characters (or ~100 UTF-8 encoded bytes) you'll get an error like this one

InvalidIndexNameException[Invalid index name [...], index name is too long, (266 > 255)]

As for the valid characters to use in an index, the best place to look for is in their test suite, but basically an index name

  • must not contain the characters #, \, /, *, ?, ", <, >, |, ,
    • Since ES 7.0 onwards, : is not allowed as well
  • must not start with _, - or +
  • must not be . or ..
  • must be lowercase

See https://www.elastic.co/guide/en/elasticsearch/reference/6.4/indices-create-index.html

Lowercase only
Cannot include \, /, *, ?, ", <, >, |, ` ` (space character), ,, #
Indices prior to 7.0 could contain a colon (:), but that’s been deprecated and won’t be supported in 7.0+
Cannot start with -, _, +
Cannot be . or ..
Cannot be longer than 255 bytes (note it is bytes, so multi-byte characters will count towards the 255 limit faster)