Can the parser plugin emit multiple events?

23 views
Skip to first unread message

Raghu Udiyar

unread,
May 26, 2017, 8:55:11 AM5/26/17
to Fluentd Google Group
Hello

Each input event has events embedded in the json structure. So this needs to be parsed and emitted as two or more events. I'm exploring the possibility of using a custom Parser plugin for this, but it only allows to return the time and record. 

Will returning a list of time, records work? As per the parser call, it doesn't look like so : parser.parse(text) { |time, record| ... }

What would be the right approach here, other than writing a custom input plugin?

Thanks,
Raghu

Mr. Fiber

unread,
May 26, 2017, 10:50:05 AM5/26/17
to Fluentd Google Group
 Will returning a list of time, records work? As per the parser call, it doesn't look like so : parser.parse(text) { |time, record| ... }

Don't return array. Call yield more than once.
This is why we changed parser API before:



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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raghu Udiyar

unread,
May 29, 2017, 1:00:58 PM5/29/17
to Fluentd Google Group
On Friday, 26 May 2017 20:20:05 UTC+5:30, repeatedly wrote:
 Will returning a list of time, records work? As per the parser call, it doesn't look like so : parser.parse(text) { |time, record| ... }

Don't return array. Call yield more than once.
This is why we changed parser API before:



Thanks Masahiro, but we just realised the parser plugin will not work for the input plugin we are using (in_kafka). I'll have to write a filter plugin. As per the docs for this I'll have to define "filter" method. But since I need to emit two or more events, I'm guessing I'll have to override "filter_stream" method. Is my understanding correct here?

Thanks,
Raghu
 

Mr. Fiber

unread,
May 30, 2017, 1:20:36 AM5/30/17
to Fluentd Google Group
 we just realised the parser plugin will not work for the input plugin we are using (in_kafka).


I'm guessing I'll have to override "filter_stream" method. Is my understanding correct here?

Correct.


--
Reply all
Reply to author
Forward
0 new messages