Can fluentd process one line input to multiline output ?

88 views
Skip to first unread message

WD Wang

unread,
Apr 25, 2015, 8:03:47 AM4/25/15
to flu...@googlegroups.com
The input message like { "header": "xxxx", "data":["sssss", "kkkk"] }

Want to output like 
{"header":"xxxx", "data":"ssssss"}
{"header":"xxxx", "data":"kkkkk"}

Have googled but did not found a result, any reply is appreciated.

WD Wang

unread,
Apr 25, 2015, 9:48:03 AM4/25/15
to flu...@googlegroups.com
Refer to out_unwind[1] plugin, I wrote a output plugin to solve this.

1. https://github.com/bitcellar-labs/fluent-plugin-unwind/blob/master/lib/fluent/plugin/out_unwind.rb

在 2015年4月25日星期六 UTC+8下午8:03:47,WD Wang写道:

Mr. Fiber

unread,
Apr 26, 2015, 2:09:57 AM4/26/15
to flu...@googlegroups.com
Awesome!

If you use fluentd v0.12 or td-agent 2.2.0,
Filter plugin is fit for this case.

In your case, overwriting filter_steam approach like record_transformer is better.


I noticed above document doesn't have actual example of filter_stream.
I will add it later.


Masahiro


--
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexandre Thomas

unread,
Apr 27, 2015, 3:00:58 AM4/27/15
to flu...@googlegroups.com
Hum, can we use out_copy to reemit 2 event with different tag ?

like this :


<match xxxx.**>
type copy
        deep_copy true
<store>
type         record_modifier
       tag           myeventpart1
remove_keys           key2
</store>
        <store>
type          record_modifier
       tag           myeventpart2
remove_keys           key1
</store>
</match>

WD Wang

unread,
Apr 29, 2015, 11:03:47 AM4/29/15
to flu...@googlegroups.com
Great! What about the performance difference between output  plugin and this?

在 2015年4月26日星期日 UTC+8下午2:09:57,repeatedly写道:
Reply all
Reply to author
Forward
0 new messages