How to disable auto index creation in Elasticsearch?

Set this in your elasticsearch.yml configs for the cluster:

action.auto_create_index: false 

That will prevent indices from being automatically created.

1 Like

Getting an error on restarting elasticsearch.
In elasticsearch.yml file I added line-

action.auto_create_index: +name*, -*

After this I tried to restart elasticsearch and I got the following error-

[2017-03-06T13:57:22,573][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [node-1] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: ElasticsearchException[Failed to load plugin class [org.elasticsearch.xpack.XPackPlugin]]; nested: InvocationTargetException; nested: IllegalArgumentException[the [action.auto_create_index] setting value [+name*, -] is too restrictive. disable [action.auto_create_index] or set it to [.watches, .triggered_watches, .watcher-history-]];