2015-10-13 99 views
0

上周我碰到了Fluentd。起初我很喜欢它(仍然如此),但似乎有一些漏洞阻止我使用它。如何将一个事件从一个匹配块转发到另一个fluentd?

我试图将我们的日志转发到两个不同的位置 - 要存档的S3存储桶和用于kibana分析的Elasticsearch数据库。我看了一下fluent-forest-plugin,但是我意识到由于this而不起作用。我尝试使用copy插件,但我得到这个错误:

[error]: config error file="/etc/td-agent/td-agent.conf" error="Other 's3' plugin already use same buffer_path: type = s3, buffer_path = /tmp/fluent-plugin-s3" 

与此配置

<source> 
    type tail 
    path /var/log/nginx/web__error.log 
    pos_file /var/tmp/nginx_web__error.pos 
    tag web__error 
    format /^(?<time>[^ ]+ [^ ]+) \[(?<log_level>.*)\] (?<pid>\d*).(?<tid>[^:]*): (?<message>.*)$/ 
</source> 
<match web__error> 
    type copy 
    <store> 
    type s3 
    aws_key_id ACC_KEY 
    aws_sec_key SEC_KEY 
    s3_bucket log-bucket 
    path web__error/ 
    buffer_path /tmp/fluent-plugin-s3 
    s3_object_key_format %{path}%{time_slice}_%{index}.%{file_extension} 
    time_slice_format %Y-%m-%d/%H 
    flush_interval 15s 
    utc 
    </store> 
    <store> 
    type elasticsearch 
    logstash_format true 
    logstash_prefix web__error 
    flush_interval 15s 
    include_tag_key true 
    utc_index true 
    </store> 
</match> 

从我读过,一旦事件被夹在一个匹配块,它不能被任何后续的抓住。作为最后的手段,我需要知道是否有任何方法可以做到这一点,我还没有找到?

回答

0

这是一个非问题 - 我忘了我在其他配置文件中使用相同的buffer_path,这导致了此错误。

相关问题