配置curator任务自动删除elasticsearch索引

mkdir config action

vi config/config.yml

client:
    hosts: ["127.0.0.1:9200"]
    url_prefix:
    use_ssl: False
    certificate:
    client_cert:
    client_key:
    aws_key:
    aws_secret_key:
    aws_region:
    ssl_no_validate: False
    http_auth:
    timeout: 36000
    master_only: False
logging:
    loglevel: INFO
    logfile:
    logformat: default
    blacklist: ['elasticsearch', 'urllib3']

vi action.yml

actions:
    1:
      action: delete_indices
      description: "Delete indices older than 10 days (based on index name), for logstash- prefixed indices."
      options:
        timeout_override:
        continue_if_exception: False
        disable_action: False
      filters:
      - filtertype: pattern
        kind: prefix
        value: logstash-
      - filtertype: age
        source: name
        direction: older
        unit: days
        unit_count: 10
        timestring: '%Y.%m.%d'
        exclude:

vi curator-manage-index.sh

#!/bin/sh
curator --config /home/elasticsearch/curator-5.2.0/config/config.yml /home/elasticsearch/curator-5.2.0/action/action.yml

crontab -e

0 1 * * * /home/elasticsearch/curator-5.2.0/curator-manage-index.sh

技术分享离不开您的支持,您的支持是我源源不断的动力。

配置curator任务自动删除elasticsearch索引_第1张图片
微信

配置curator任务自动删除elasticsearch索引_第2张图片
支付宝

你可能感兴趣的:(配置curator任务自动删除elasticsearch索引)