collect docker logs

This commit is contained in:
Pim Kunis 2023-08-22 22:49:18 +02:00
parent 6546fc8fb7
commit 64594da273
3 changed files with 59 additions and 24 deletions

View file

@ -1,26 +1,33 @@
hypervisors:
hosts:
atlas:
ansible_host: atlas.hyp
jefke:
ansible_host: jefke.hyp
lewis:
ansible_host: lewis.hyp
swarm:
hosts:
maestro:
ansible_host: maestro.dmz
bancomart:
ansible_host: bancomart.dmz
handjecontantje:
ansible_host: handjecontantje.dmz
vms:
children:
swarm:
hosts:
concourse:
ansible_host: concourse.dmz
thecloud:
ansible_host: thecloud.dmz
hermes:
ansible_host: hermes.dmz
all:
children:
hypervisors:
hosts:
atlas:
ansible_host: atlas.hyp
jefke:
ansible_host: jefke.hyp
lewis:
ansible_host: lewis.hyp
vms:
hosts:
maestro:
ansible_host: maestro.dmz
bancomart:
ansible_host: bancomart.dmz
handjecontantje:
ansible_host: handjecontantje.dmz
concourse:
ansible_host: concourse.dmz
thecloud:
ansible_host: thecloud.dmz
nextcloud:
ansible_host: nextcloud.dmz
hermes:
ansible_host: hermes.dmz

View file

@ -82,6 +82,13 @@
#
# storage.backlog.mem_limit 5M
{% if 'swarm' in group_names %}
[INPUT]
Name forward
Listen 0.0.0.0
Port 22222
{% endif %}
[INPUT]
Name cpu
Tag cpu
@ -103,7 +110,7 @@
[OUTPUT]
Name forward
Match *
Match **
Host maestro.dmz
Port {{ fluent_forward_port }}
@ -119,9 +126,22 @@
Key_Name exec
Parser diskfree
{% if 'swarm' in group_names %}
[FILTER]
Name parser
Match docker.forgejo_forgejo.**
Key_Name log
Parser combinedlog
[FILTER]
Name grep
Match docker.forgejo_forgejo.**
Regex host .*
{% endif %}
[FILTER]
Name record_modifier
Match *
Match **
Record hostname ${HOSTNAME}
[FILTER]

View file

@ -10,3 +10,11 @@
Format regex
Regex ^\S+\s+\d+\s+(?<disk_used>\d+)\s+(?<disk_available>\d+)\s+(?<disk_percentage>\d+)%\s+(?<disk_mount>\S+)
Types disk_used:integer disk_available:integer disk_percentage:integer disk_mount:string
[PARSER]
Name combinedlog
Format regex
Regex ^(?<host>\S+)\ (?<ident>\S+)\ (?<authuser>\S+)\ \[(?<date>[^\]]+)\]\ \"(?<request>\S+\ .+ HTTP\/\d\.\d)\"\ (?<status>\S+)\ (?<size>\S+)\ \"(?<referer>[^\"]*)\" \"(?<useragent>[^\"]*)\"
Types host:string ident:string authuser:string request:string status:integer size:integer referer:string useragent:string
Time_Key date
Time_Format %d/%b/%Y:%H:%M:%S %z