fluentd
fluentd copied to clipboard
in_tail can't send data to elasticsearch
Hi,
I have about 14 docker containers, I used fluentd in tail mode to read logs from path : /var/lib/docker/containers/*/*-json.log
my fluent.conf:
<source>
type tail
read_from_head true
pos_file fluentd-docker.pos
path /var/lib/docker/containers/*/*-json.log
time_format %Y-%m-%dT%H:%M:%S
tag docker.*
format json
</source>
<match docker.**>
type elasticsearch
log_level info
host es1
port 9200
include_tag_key true
logstash_format true
flush_interval 5s
</match>
the output I get is
2018-02-15 16:56:51 +0000 [info]: reading config file path="/fluentd/etc/fluent.conf"
2018-02-15 16:56:51 +0000 [info]: starting fluentd-0.12.42
2018-02-15 16:56:51 +0000 [info]: gem 'fluent-plugin-elasticsearch' version '1.9.2'
2018-02-15 16:56:51 +0000 [info]: gem 'fluentd' version '0.12.42'
2018-02-15 16:56:51 +0000 [info]: adding match pattern="docker.**" type="elasticsearch"
2018-02-15 16:56:51 +0000 [info]: adding source type="tail"
2018-02-15 16:56:51 +0000 [info]: using configuration file: <ROOT>
<source>
type tail
read_from_head true
pos_file fluentd-docker.pos
path /var/lib/docker/containers/*/*-json.log
time_format %Y-%m-%dT%H:%M:%S
tag docker.*
format json
</source>
<match docker.**>
type elasticsearch
log_level info
host es-coordinator1
port 9200
include_tag_key true
logstash_format true
flush_interval 5s
</match>
</ROOT>
2018-02-15 16:56:51 +0000 [info]: following tail of /var/lib/docker/containers/778ff293c5725e9e60ff2d7782431ac0070846f8c9e40c65ade9a706768aef4f/778ff293c5725e9e60ff2d7782431ac0070846f8c9e40c65ade9a706768aef4f-json.log
2018-02-15 16:56:51 +0000 [info]: following tail of /var/lib/docker/containers/386460efa88f10cd2397ea6782cf574bcef81560f790f083c6d69819db80d819/386460efa88f10cd2397ea6782cf574bcef81560f790f083c6d69819db80d819-json.log
2018-02-15 16:56:51 +0000 [info]: following tail of /var/lib/docker/containers/b31b53d52699205f2e86688a41c13517a70659710958c7a31ee92f2a6645cd59/b31b53d52699205f2e86688a41c13517a70659710958c7a31ee92f2a6645cd59-json.log
2018-02-15 16:56:54 +0000 [info]: Connection opened to Elasticsearch cluster => {:host=>"es1", :port=>9200, :scheme=>"http"}
2018-02-15 16:57:33 +0000 [info]: following tail of /var/lib/docker/containers/3aab82ab422598b1188e2bc7d5c7cc5c6b58e1285561e1da014d9557dd1a6151/3aab82ab422598b1188e2bc7d5c7cc5c6b58e1285561e1da014d9557dd1a6151-json.log
2018-02-15 16:57:33 +0000 [info]: following tail of /var/lib/docker/containers/f8000c52fe5aab41d131916ceb48d7b8afb19390cd36844b3070396016aa13dd/f8000c52fe5aab41d131916ceb48d7b8afb19390cd36844b3070396016aa13dd-json.log
2018-02-15 16:57:33 +0000 [info]: following tail of /var/lib/docker/containers/bdf7f630b5f7304a89a9d4097b66409bf1f8ac492c8566ac8e35d3b40797ca0d/bdf7f630b5f7304a89a9d4097b66409bf1f8ac492c8566ac8e35d3b40797ca0d-json.log
2018-02-15 16:57:33 +0000 [info]: following tail of /var/lib/docker/containers/170dfc7a4834713bd3b9e70a6b1d1114b89e634d35b477bb6b4a72b75c15e202/170dfc7a4834713bd3b9e70a6b1d1114b89e634d35b477bb6b4a72b75c15e202-json.log
But nothing is sent to elasticsearch as I check in kibana, is it a problem in my configuration?
have you tried out_stdout to verify if the data is flowing though in_tail?
Even im getting the same error
This seems not fluentd core issue, so closed. Please check your network traffic, elasticsearch setting and logs.