feat(logs): make it so rule logs-setup isn't necessary

This commit is contained in:
Maieul BOYER 2025-11-14 17:58:45 +01:00
parent 3ef811b334
commit 8dd0a74046
No known key found for this signature in database
9 changed files with 49 additions and 11 deletions

19
logs/elasticsearch/bootstrap.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh
setup_ilm() {
set -xe
until curl -s -f http://localhost:9200 >/dev/null; do
sleep 2;
done;
curl -v -X PUT "localhost:9200/_ilm/policy/docker-logs-policy" \
-H "Content-Type: application/json" \
-d '@/setup/docker-logs-policy.json'
curl -v -X PUT "localhost:9200/_template/docker-logs-template" \
-H "Content-Type: application/json" \
-d '@/setup/docker-logs-template.json'
exit 0
}
setup_ilm &
exec /usr/local/bin/docker-entrypoint.sh eswrapper >/dev/null

View file

@ -0,0 +1,15 @@
{
"policy": {
"phases": {
"hot": {
"actions": {}
},
"delete": {
"min_age": "7d",
"actions": {
"delete": {}
}
}
}
}
}

View file

@ -0,0 +1 @@
{"index_patterns":["docker-*"],"settings":{"index.lifecycle.name":"docker-logs-policy"}}}