Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: index_not_found_exception

I use ELK stack to analyze my log file. I have tested last week and everything works well.

Today, I tested but I get this error when I typed "http://localhost:9200/iot_log/_count" (iot_log is my index pattern):

{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"iot_log","index_uuid":"na","index":"iot_log"}],"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"iot_log","index_uuid":"na","index":"iot_log"},"status":404}

I really searched the forums but I have not found a solution, I want to know what is the cause of this problem please and how can I correct it?

like image 264
Fariha Avatar asked Jan 23 '17 11:01

Fariha


2 Answers

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" : { } }}'

like image 65
Yao Li Avatar answered Sep 18 '22 19:09

Yao Li


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.

like image 42
misterbaykal Avatar answered Sep 21 '22 19:09

misterbaykal