Periodic index creation

Products

JCS for Elasticsearch

2022-02-21 06:56:23

Periodic index creation

The periodic index creation function can help users manage the whole life cycle process of index from creation to deletion.

Precondition

Before executing the periodic index creation task, it is necessary to ensure that there are available index templates.

Create index task

On the list page, click "Operation - More - Periodic Index Creation" to enter the periodic index creation page, and click "Add" to enter the index task creation page.

  • Index Template: Can be created via command line tools or kibana-Dev Tools.

Sample index templates created by command line tool:

curl -XPUT localhost:9200/_template/template05 \
-H"Content-Type:application/json" \
-d '{
  "index_patterns": ["template05*"] ,    //Applicable to versions above 6.X, and versions below 6.X should be replaced with "template": "xie-", 
  "settings": {
    "number_of_shards": 2
  },
  "mappings": {
    "_doc": {
      "_source": {
        "enabled": false
      },
      "properties": {
        "name": {
          "type": "keyword"
        },
        "created_at": {
          "type": "date",
          "format": "EEE MMM dd HH:mm:ss Z YYYY"
        }
      }
    }
  }
}'
Kibana - Sample index template created by Dev Tools:
PUT /_template/my_logs 
{
  "index_patterns": ["template05*"] ,    //Applicable to versions above 6.X, and versions below 6.X should be replaced with "template": "template05*",  
  "order": 1, 
  "settings": {
    "number_of_shards": 1 
  },
  "mappings": {
    "_default_": { 
      "_all": {
        "enabled": false
      }
    }
  },
  "aliases": {
    "last_3_months": {} 
  }
}
  • Index Prefix: The corresponding template matches the result of the index, that is, being consistent with the value of the index_patterns field. In the example, the corresponding index prefix is template05.
  • Execution start time: The time to create an index task for each execution cycle.
  • Execution cycle: By day or by month.
  • Index Suffix: Definition of time format. Example: 2018-10-10" corresponds to "yyyy-MM-dd".
  • Periodically delete indexes: When the switch is turned on, the index storage time can be set, and indexes whose storage time expires are automatically deleted.
  • Index storage time: After setting, the index will be automatically deleted when it expires.
  • Delete Neglect Index After setting, the indexes will not be deleted periodically, are separated with a commas (,). For example, "pop_jd_log_" template needs to be retained for a long time, then fill in pop_jd_log_20180618,pop_jd_log_20181111.
  • Index Template Content Correspondingly display the contents of the selected index template.

Edit index task

After adding the task of periodically creating an index, you can modify the task by clicking "Action - Edit". The index prefix, execution period, index suffix, and periodic index deletion can be modified.

View index task

After adding or editing the task of periodically creating an index, you can click "Action - Details" to view the basic information and template information of the index task.

Delete index task

After confirming that the periodic task is no longer used, you can delete the it by clicking "Operation - Delete".

Feedback

开始与售前顾问沟通

可直接拨打电话 400-098-8505转1

我们的产品专家为您找到最合适的产品/解决⽅案

在线咨询 5*8⼩时

1v1线上咨询获取售前专业咨询

点击咨询
企微服务助手

专业产品顾问,随时随地沟通