不同文件是否可以发送到不同topic
Closed this issue · 2 comments
liangsp commented
不同文件是否可以发送到不同topic
liangsp commented
配置文件
input {
file {
path => ["/RocOut/logstash-6.7.1/self_files/*01.bat"]
sincedb_path => "/dev/null"
start_position => "beginning"
tags => ["acct-01"]
}
file {
path => ["/RocOut/logstash-6.7.1/self_files/*02.bat"]
sincedb_path => "/dev/null"
start_position => "beginning"
tags => ["acct-02"]
}
}
output {
stdout {}
if "acct-01" in [tags] {
rocketmq {
codec => plain {
format => "%{message}"
}
logstash_path => "/RocOut/logstash-6.7.1"
name_server_addr => "172.18.56.57:9876"
topic => "t-acct-01"
}
}
else if "acct-02" in [tags] {
rocketmq {
codec => plain {
format => "%{message}"
}
logstash_path => "/RocOut/logstash-6.7.1"
name_server_addr => "172.18.56.57:9876"
topic => "t-acct-02"
}
}
}
PriestTomb commented
@liangsp 非常非常抱歉我一直没注意到什么时候开了这个 issue 。。没收到任何提醒
不知道你是否已经按上述配置验证过了,我看了下你的配置,并且也做了类似的测试,我的答案是可以这么配置,并且能实现采集不同的文件将其发送至不同的 TOPIC
如果在使用的过程中还有什么问题,欢迎提出来