Error: index_not_found_exception Error: index_not_found_exception elasticsearch elasticsearch

Error: index_not_found_exception


Make sure index iot_log exist and create it if not:

curl -X PUT "localhost:9200/iot_log" -H 'Content-Type: application/json' -d'{ "settings" : { "index" : { } }}'


You need to set your action.auto_create_index parameter in elasticsearch.yml file.

Example:

action.auto_create_index: -l*,+z*

With this kind of configuration, indexes starting with "z" will be created automatically while indexes starting with "l" will not.


The best way to resolve it by using setting as follow

Allow Auto Create YourIndexName and index10 and not allowing any index name matching index1* and any other index matching ind*. The patterns are matched in the order they are given.

curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d'{    "persistent": {        "action.auto_create_index": "YourIndexName,index10,-index1*,+ind*"     }}'

Stop any Auto Indexing

curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d'{    "persistent": {        "action.auto_create_index": "false"     }}'

Allow any Index create automatically

curl -X PUT "localhost:9200/_cluster/settings?pretty" -H 'Content-Type: application/json' -d'{    "persistent": {        "action.auto_create_index": "true"     }}'```