1
0
Fork 0
mirror of https://gitlab.com/shouptech/flux.git synced 2026-02-03 17:09:45 +00:00

Compare commits

...

9 commits

Author SHA1 Message Date
9713453a53 Fixes 2020-04-19 10:28:19 -06:00
11f516b7e8 Parse nextcloud app log 2020-04-19 10:16:57 -06:00
2aa26b5a22 Fix flux json arg 2020-04-19 10:05:04 -06:00
3d16c9b425 Parse flux as json 2020-04-19 09:03:50 -06:00
7a338c4a2e Add logs for flux 2020-04-19 08:59:38 -06:00
4cf178c8fd Fix syntax 2020-04-19 08:54:06 -06:00
2867634567 Do it this way 2020-04-19 08:50:43 -06:00
18cb5acccf Use labels 2020-04-19 08:44:11 -06:00
544c968654 Match echoserver logs 2020-04-19 08:37:29 -06:00
3 changed files with 38 additions and 3 deletions

View file

@ -213,6 +213,9 @@ spec:
# Enable garbage collection # Enable garbage collection
- --sync-garbage-collection - --sync-garbage-collection
# Set log format to json
- --log-format=json
# Optional DNS settings, configuring the ndots option may resolve # Optional DNS settings, configuring the ndots option may resolve
# nslookup issues on some Kubernetes setups. # nslookup issues on some Kubernetes setups.
# dnsPolicy: "None" # dnsPolicy: "None"

View file

@ -10,6 +10,7 @@ data:
@include "#{ENV['FLUENTD_SYSTEMD_CONF'] || 'systemd'}.conf" @include "#{ENV['FLUENTD_SYSTEMD_CONF'] || 'systemd'}.conf"
@include "#{ENV['FLUENTD_PROMETHEUS_CONF'] || 'prometheus'}.conf" @include "#{ENV['FLUENTD_PROMETHEUS_CONF'] || 'prometheus'}.conf"
@include kubernetes.conf @include kubernetes.conf
@include nextcloud.conf
@include conf.d/*.conf @include conf.d/*.conf
@include filters.conf @include filters.conf
@ -54,26 +55,50 @@ data:
disable.conf: "" disable.conf: ""
filters.conf: | filters.conf: |
<filter kubernetes.var.log.containers.nextcloud-**> <filter kubernetes.var.log.containers.nextcloud-** kubernetes.var.log.containers.echoserver-**>
@type parser @type parser
key_name log key_name log
reserve_data true reserve_data true
inject_key_prefix apache2.
<parse> <parse>
@type apache2 @type apache2
</parse> </parse>
</filter> </filter>
<filter kubernetes.var.log.containers.hass-**> <filter kubernetes.var.log.containers.hass-**>
@type parser @type parser
key_name log key_name log
reserve_data true reserve_data true
inject_key_prefix hass.
<parse> <parse>
@type regexp @type regexp
expression /^(?<logtime>.*) (?<level>.*) \((?<thread>.*)\) \[(?<source>.*)\] (?<message>.*)$/ expression /^(?<logtime>.*) (?<level>.*) \((?<thread>.*)\) \[(?<source>.*)\] (?<message>.*)$/
</parse> </parse>
</filter> </filter>
<filter kubernetes.var.log.containers.flux-**>
@type parser
key_name log
reserve_data true
<parse>
@type json
</parse>
</filter>
nextcloud.conf: |
<source>
@type tail
@id in_tail_nextcloud_log
path /opt/nextcloud/nextcloud.log
pos_file /var/log/nextcloud.log.pos
tag nextcloud.log
read_from_head true
reserve_data true
<parse>
@type json
time_key time
time_format %Y-%m-%dT%H:%M:%S%z
</parse>
</source>
kubernetes.conf: | kubernetes.conf: |
<label @FLUENT_LOG> <label @FLUENT_LOG>
<match fluent.**> <match fluent.**>

View file

@ -105,6 +105,9 @@ spec:
readOnly: true readOnly: true
- name: config-volume - name: config-volume
mountPath: /fluentd/etc mountPath: /fluentd/etc
- name: nextcloud-data
mountPath: /opt/nextcloud/nextcloud.log
subPath: data/nextcloud.log
terminationGracePeriodSeconds: 30 terminationGracePeriodSeconds: 30
volumes: volumes:
- name: varlog - name: varlog
@ -116,3 +119,7 @@ spec:
- name: config-volume - name: config-volume
configMap: configMap:
name: fluentd-logging name: fluentd-logging
- name: nextcloud-data
hostPath:
path: /opt/nextcloud/pod
type: Directory