This commit is contained in:
marcel-dempers 2020-09-27 15:27:53 +10:00 committed by Marcel Dempers
parent b0a6b7af40
commit 0a6f7ebad0
5 changed files with 86 additions and 25 deletions

View File

@ -0,0 +1,13 @@
<source>
@type tail
format json
read_from_head true
tag docker.log
path /fluentd/log/containers/*/*-json.log
pos_file /tmp/container-logs.pos
</source>
# <match docker.log>
# @type file
# path /output/docker.log
# </match>

View File

@ -0,0 +1,26 @@
# where to send http logs
<match http-*.log>
@type elasticsearch
host elasticsearch
port 9200
index_name fluentd-http
type_name fluentd
</match>
#where to send file logs
<match file-myapp.log>
@type elasticsearch
host elasticsearch
port 9200
index_name fluentd-file
type_name fluentd
</match>
#where to send docker logs
<match docker.log>
@type elasticsearch
host elasticsearch
port 9200
index_name fluentd-docker
type_name fluentd
</match>

View File

@ -0,0 +1,20 @@
<source>
@type tail
format json
read_from_head true
tag file-myapp.log
path /fluentd/log/files/example-log.log
pos_file /tmp/example-log.log.pos
</source>
<filter file-myapp.log>
@type record_transformer
<record>
host_param "#{Socket.gethostname}"
</record>
</filter>
# <match file-myapp.log>
# @type file
# path /output/file-myapp.log
# </match>

View File

@ -1,33 +1,16 @@
################################################################
# This source reads tail of a file
<source>
@type tail
format json
read_from_head true
tag file-myapp.log
path /fluentd/log/files/example-log.log
pos_file /tmp/example-log.log.pos
</source>
<match file-myapp.log>
@type file
path /output/file-myapp.log
</match>
@include file-fluent.conf
################################################################
# This source gets incoming logs over HTTP
<source>
@type http
port 9880
bind 0.0.0.0
body_size_limit 32m
keepalive_timeout 10s
</source>
<match http-*.log>
@type file
path /output/http.log
</match>
@include http-fluent.conf
################################################################
# This source gets all logs from local docker host
@include containers-fluent.conf
################################################################
# Send all logs to elastic search
@include elastic-fluent.conf

View File

@ -0,0 +1,19 @@
<source>
@type http
port 9880
bind 0.0.0.0
body_size_limit 32m
keepalive_timeout 10s
</source>
<filter http-*.log>
@type record_transformer
<record>
host_param "#{Socket.gethostname}"
</record>
</filter>
# <match http-*.log>
# @type file
# path /output/http.log
# </match>