apache flume,在同一个源上有两个不同的拦截器

fruv7luv  于 2021-06-04  发布在  Flume
关注(0)|答案(1)|浏览(400)

我正在尝试在同一个源上添加两个不同的拦截器,并将截获的数据发送到两个不同的通道。但是,我无法配置相同的。找不到任何与此相关的文档。此外,我有一些问题与频道选择器。不知道如何用不同的拦截器选择一个频道。
以下是我目前的代码:

a1.sources = syslog_udp
a1.channels = chan1 chan2
a1.sinks = sink1 sink2 //both are different kafka sinks

a1.sources.syslog_udp.type = syslogudp
a1.sources.syslog_udp.port = 514
a1.sources.syslog_udp.host = 0.0.0.0
a1.sources.syslog_udp.keepFields = true

a1.sources.syslog_udp.interceptors = i1 i2
a1.sources.syslog_udp.interceptors.i1.type = regex_filter
a1.sources.syslog_udp.interceptors.i1.regex = '<regex_string1>'
a1.sources.syslog_udp.interceptors.i1.excludeEvents = false

a1.sources.syslog_udp.interceptors.i2.type = regex_filter
a1.sources.syslog_udp.interceptors.i2.regex = '<regex_string1>'|'<regex_string2>'
a1.sources.syslog_udp.interceptors.i2.excludeEvents = false

a1.sources.syslog_udp.selector.type = multiplexing
a1.sources.syslog_udp.channels = chan1 chan2

a1.channels.chan1.type = memory
a1.channels.chan1.capacity = 200
a1.channels.chan2.type = memory
a1.channels.chan2.capacity = 200
x4shl7ld

x4shl7ld1#

似乎没有直接的设置。这种布局的一个解决方法是在一个代理中有一个单一/更宽的通道拦截器,通过管道将输出传输到avro接收器,为avro源设置一个新代理,并在该代理上设置新的通道拦截器。

相关问题