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,6 +1,4 @@
all: hypervisors:
children:
hypervisors:
hosts: hosts:
atlas: atlas:
ansible_host: atlas.hyp ansible_host: atlas.hyp
@ -8,7 +6,8 @@ all:
ansible_host: jefke.hyp ansible_host: jefke.hyp
lewis: lewis:
ansible_host: lewis.hyp ansible_host: lewis.hyp
vms:
swarm:
hosts: hosts:
maestro: maestro:
ansible_host: maestro.dmz ansible_host: maestro.dmz
@ -16,11 +15,19 @@ all:
ansible_host: bancomart.dmz ansible_host: bancomart.dmz
handjecontantje: handjecontantje:
ansible_host: handjecontantje.dmz ansible_host: handjecontantje.dmz
vms:
children:
swarm:
hosts:
concourse: concourse:
ansible_host: concourse.dmz ansible_host: concourse.dmz
thecloud: thecloud:
ansible_host: thecloud.dmz ansible_host: thecloud.dmz
nextcloud:
ansible_host: nextcloud.dmz
hermes: hermes:
ansible_host: hermes.dmz ansible_host: hermes.dmz
all:
children:
hypervisors:
vms:

View file

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

View file

@ -10,3 +10,11 @@
Format regex Format regex
Regex ^\S+\s+\d+\s+(?<disk_used>\d+)\s+(?<disk_available>\d+)\s+(?<disk_percentage>\d+)%\s+(?<disk_mount>\S+) 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 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