![Elasticsearch 큐레이터가 이전 인덱스를 삭제하지 않음](https://rvso.com/image/170301/Elasticsearch%20%ED%81%90%EB%A0%88%EC%9D%B4%ED%84%B0%EA%B0%80%20%EC%9D%B4%EC%A0%84%20%EC%9D%B8%EB%8D%B1%EC%8A%A4%EB%A5%BC%20%EC%82%AD%EC%A0%9C%ED%95%98%EC%A7%80%20%EC%95%8A%EC%9D%8C.png)
저는 로그 파일을 요약하기 위해 Elasticsearch + Kibana + File-/Metric-/Winlogbeat를 사용하고 있습니다. 내 HDD를 수많은 로그로 채우지 않기 위해 14일 동안만 보관하고 싶었습니다. 그래서 이 작업을 대신 수행하기 위해 Curator를 설치했습니다. 안타깝게도 큐레이터는 다음과 같은 이유로 로그를 삭제하지 않습니다.빈 목록. 큐레이터가 삭제하기에 적합한 인덱스가 없다고 생각하는 이유를 알 수 없었습니다.
내 action.yml은 다음과 같습니다
actions:
1:
action: delete_indices
description: >-
Delete indices older than 30 days (based on index name), for winlogbeat-
prefixed indices. Ignore the error if the filter does not result in an
actionable list of indices (ignore_empty_list) and exit cleanly.
options:
ignore_empty_list: True
timeout_override:
continue_if_exception: False
disable_action: False
filters:
- filtertype: pattern
kind: prefix
value: winlogbeat-
- filtertype: age
source: name
direction: older
timestring: '%Y.%m.%d'
unit: days
unit_count: 14
내 Winlog 인덱스의 이름은 다음과 같습니다.
winlogbeat-7.5.2-2020.04.01-000033
winlogbeat-7.5.2-2020.04.02-000034
여러 가지를 시도했지만 문제는 그대로 유지되었습니다.
내 문제를 어떻게 해결할 수 있는지 아시나요?
답변1
좋아, 나에게 유일하게 작동하는 솔루션은 curator_cli를 수동으로 실행하는 것입니다. 하지만 cronjob에 의해 수행됩니다.
curator_cli --config /home/user/curator.yml delete_indices --filter_list '[{"filtertype":"age","source":"creation_date","direction":"older","timestring":"%Y.%m.%d","unit":"days","unit_count":7},{"filtertype":"pattern","kind":"prefix","value":"winlogbeat-"}]'