моя запись выглядит следующим образом
[{"type":"click","level":"error"},
{"type":"show", "level": "info"}]
Я хотел бы записать запись в различные выходные данные в зависимости от значения "type", поэтому я использовал то, что было предложено в этом сообщении SO: Fluentd: несколько форматов в одном совпадении
, но, похоже, это не работает. что-то не так с моим конфигом?
<match input>
@type copy
<store>
@type rewrite_tag_filter
<rule>
key type
pattern /^\[(\w+)\]/
tag ${tag}.$1
</rule>
</store>
<store>
@type rewrite_tag_filter
<rule>
key type
pattern /^\[(\w+)\]/
tag ${tag}.$1
</rule>
</store>
</match>
<match input.click>
@type copy
<store>
@type file
path /tmp/fluent/click
append true
## compress gzip
</store>
<store>
@type mongo
host localhost
port 27017
database fluentd
collection click
<buffer>
# flush
flush_interval 10s
</buffer>
</store>
</match>
<match input.show>
@type copy
<store>
@type file
path /tmp/fluent/show
append true
## compress gzip
</store>
<store>
@type mongo
host localhost
port 27017
database fluentd
collection show
<buffer>
# flush
flush_interval 10s
</buffer>
</store>
</match>