sfsdf
This commit is contained in:
17
docker/elk/extensions/curator/Dockerfile
Executable file
17
docker/elk/extensions/curator/Dockerfile
Executable file
@@ -0,0 +1,17 @@
|
||||
FROM bitnami/elasticsearch-curator:5.8.1
|
||||
|
||||
USER root
|
||||
|
||||
RUN install_packages cron && \
|
||||
echo \
|
||||
'* * * * *' \
|
||||
root \
|
||||
LC_ALL=C.UTF-8 LANG=C.UTF-8 \
|
||||
/opt/bitnami/python/bin/curator \
|
||||
--config=/usr/share/curator/config/curator.yml \
|
||||
/usr/share/curator/config/delete_log_files_curator.yml \
|
||||
'>/proc/1/fd/1' '2>/proc/1/fd/2' \
|
||||
>>/etc/crontab
|
||||
|
||||
ENTRYPOINT ["cron"]
|
||||
CMD ["-f", "-L8"]
|
||||
20
docker/elk/extensions/curator/README.md
Executable file
20
docker/elk/extensions/curator/README.md
Executable file
@@ -0,0 +1,20 @@
|
||||
# Curator
|
||||
|
||||
Elasticsearch Curator helps you curate or manage your indices.
|
||||
|
||||
## Usage
|
||||
|
||||
If you want to include the Curator extension, run Docker Compose from the root of the repository with an additional
|
||||
command line argument referencing the `curator-compose.yml` file:
|
||||
|
||||
```bash
|
||||
$ docker-compose -f docker-compose.yml -f extensions/curator/curator-compose.yml up
|
||||
```
|
||||
|
||||
This sample setup demonstrates how to run `curator` every minute using `cron`.
|
||||
|
||||
All configuration files are available in the `config/` directory.
|
||||
|
||||
## Documentation
|
||||
|
||||
[Curator Reference](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html)
|
||||
12
docker/elk/extensions/curator/config/curator.yml
Executable file
12
docker/elk/extensions/curator/config/curator.yml
Executable file
@@ -0,0 +1,12 @@
|
||||
# Curator configuration
|
||||
# https://www.elastic.co/guide/en/elasticsearch/client/curator/current/configfile.html
|
||||
|
||||
client:
|
||||
hosts:
|
||||
- elasticsearch
|
||||
port: 9200
|
||||
http_auth: elastic:changeme
|
||||
|
||||
logging:
|
||||
loglevel: INFO
|
||||
logformat: default
|
||||
21
docker/elk/extensions/curator/config/delete_log_files_curator.yml
Executable file
21
docker/elk/extensions/curator/config/delete_log_files_curator.yml
Executable file
@@ -0,0 +1,21 @@
|
||||
actions:
|
||||
1:
|
||||
action: delete_indices
|
||||
description: >-
|
||||
Delete indices. Find which to delete by first limiting the list to
|
||||
logstash- prefixed indices. Then further filter those to prevent deletion
|
||||
of anything less than the number of days specified by unit_count.
|
||||
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: creation_date
|
||||
direction: older
|
||||
unit: days
|
||||
unit_count: 2
|
||||
20
docker/elk/extensions/curator/curator-compose.yml
Executable file
20
docker/elk/extensions/curator/curator-compose.yml
Executable file
@@ -0,0 +1,20 @@
|
||||
version: '3.2'
|
||||
|
||||
services:
|
||||
curator:
|
||||
build:
|
||||
context: extensions/curator/
|
||||
init: true
|
||||
volumes:
|
||||
- type: bind
|
||||
source: ./extensions/curator/config/curator.yml
|
||||
target: /usr/share/curator/config/curator.yml
|
||||
read_only: true
|
||||
- type: bind
|
||||
source: ./extensions/curator/config/delete_log_files_curator.yml
|
||||
target: /usr/share/curator/config/delete_log_files_curator.yml
|
||||
read_only: true
|
||||
networks:
|
||||
- elk
|
||||
depends_on:
|
||||
- elasticsearch
|
||||
Reference in New Issue
Block a user