2016-10-18 37 views
0

我有一个简单fluentd配置:fluentd没有标记的事件正确

<source> 
    type forward 
</source> 

<source> 
    type tail 
    path /var/log/nginx/access.log 
    pos_file /var/log/td-agent/nignx-access.log 
    tag nginx.access 
    format nginx 
</source> 

<source> 
    type tail 
    path /var/log/nginx/error.log 
    pos_file /var/log/td-agent/nginx-error.log 
    tag nginx.error 
    format nginx 
</source> 

然后,我有来源后适当<match>标签。这些日志将被发送到AWS上的ElasticSearch实例。问题是,他们出现,但没有标签。所以nginx访问日志正常显示,但没有'nginx.access'标签。这会导致问题,因为现在没有办法对日志进行分类。

回答

0

感谢@repeatedly上fluentd的松弛:

包括这在比赛中标签:

<match my.logs> 
    @type elasticsearch 
    include_tag_key true 
    tag_key _key 
</match> 
相关问题