This commit is contained in:
marcel-dempers 2020-09-22 22:12:49 +10:00 committed by Marcel Dempers
parent 5cd2b71a85
commit 474770827c
2 changed files with 35 additions and 5 deletions

View File

@ -1,4 +1,5 @@
# This source gets incoming logs over HTTP and sends them to elastic search
# incoming http --> elastic search
<source>
@type http
port 9880
@ -7,18 +8,49 @@
keepalive_timeout 10s
</source>
#container logs --> elastic search
<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>
#local file --> elastic search
<source>
@type tail
format json
read_from_head true
tag file-myapp.log
path /app/example-log.log
pos_file /tmp/example-log.log.pos
</source>
# where to send http logs
<match http-*.log>
@type elasticsearch
host elasticsearch
port 9200
index_name fluentd
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
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

@ -1,6 +1,4 @@
@include elastic-fluent.conf
################################################################
# This source reads tail of a file
<source>
@type tail