Failed to set for index it should be dash delimited – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 2.3-2.3

Briefly, this error occurs when the index name in Elasticsearch is not dash-delimited. Elasticsearch requires index names to be lowercase and not contain any spaces or special characters, except for a dash (-). To resolve this issue, you can rename the index using a dash-delimited format. For example, instead of “myIndex”, use “my-index”. Alternatively, you can use an alias to refer to the index with a non-dash-delimited name. However, it’s best to stick to the naming conventions to avoid such errors.

This guide will help you check for common problems that cause the log ” failed to set [{}] for index [{}]; it should be dash delimited [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: cluster, index, metadata and settings.

Log Context

Log “failed to set [{}] for index [{}]; it should be dash delimited [{}]” classname is MetaDataUpdateSettingsService.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

final int min;
                    final int max;

                    final int dash = autoExpandReplicas.indexOf('-');
                    if (-1 == dash) {
                        logger.warn("failed to set [{}] for index [{}]; it should be dash delimited [{}]";
                                IndexMetaData.SETTING_AUTO_EXPAND_REPLICAS; indexMetaData.getIndex(); autoExpandReplicas);
                        continue;
                    }
                    final String sMin = autoExpandReplicas.substring(0; dash);
                    try {

 

 [ratemypost]