You've already forked dockerfiles
mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-07-15 01:14:25 +02:00
add script for elk
This commit is contained in:
@ -4,3 +4,34 @@ ELK
|
|||||||
- Elasticsearch
|
- Elasticsearch
|
||||||
- Logstash
|
- Logstash
|
||||||
- Kibana
|
- Kibana
|
||||||
|
|
||||||
|
## Delete indices older than 7 days
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
---
|
||||||
|
actions:
|
||||||
|
1:
|
||||||
|
action: delete_indices
|
||||||
|
description: >-
|
||||||
|
Delete indices older than 7 days (based on index name), for logstash-
|
||||||
|
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
|
||||||
|
disable_action: False
|
||||||
|
filters:
|
||||||
|
- filtertype: pattern
|
||||||
|
kind: prefix
|
||||||
|
value: logstash-
|
||||||
|
- filtertype: age
|
||||||
|
source: name
|
||||||
|
direction: older
|
||||||
|
timestring: '%Y.%m.%d'
|
||||||
|
unit: days
|
||||||
|
unit_count: 7
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ pip install elasticsearch-curator
|
||||||
|
$ curator delete-indices.yml
|
||||||
|
```
|
||||||
|
21
elk/delete-indices.yml
Normal file
21
elk/delete-indices.yml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
actions:
|
||||||
|
1:
|
||||||
|
action: delete_indices
|
||||||
|
description: >-
|
||||||
|
Delete indices older than 7 days (based on index name), for logstash-
|
||||||
|
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
|
||||||
|
disable_action: False
|
||||||
|
filters:
|
||||||
|
- filtertype: pattern
|
||||||
|
kind: prefix
|
||||||
|
value: logstash-
|
||||||
|
- filtertype: age
|
||||||
|
source: name
|
||||||
|
direction: older
|
||||||
|
timestring: '%Y.%m.%d'
|
||||||
|
unit: days
|
||||||
|
unit_count: 7
|
Reference in New Issue
Block a user