Is there any documentation or explanation on how to use "__send__"

29 views
Skip to first unread message

Marco Pas

unread,
Jun 7, 2016, 11:53:00 PM6/7/16
to Fluentd Google Group
In a post from 2015 i read some information on how to use "__send__" to process record information using record_transformer. Is there any official documentation on that?
When and how to use "__send__" if there is a need to work on the data inside a fluentd record?

Naotoshi Seo

unread,
Jun 8, 2016, 2:18:19 AM6/8/16
to Fluentd Google Group

Before, we needed to use `__send__` to get a value in a record whose key contains dot such as `__send__("foo.bar")`.
Now, record-transformer supports `$record["foo.bar"]`, so __send__ should not be required anymore.

So, I will not write about it on a documentation.

Regards,
Naotoshi a.k.a. sonots

Marco Pas

unread,
Jun 8, 2016, 3:58:53 AM6/8/16
to flu...@googlegroups.com, Naotoshi Seo
Could you give a pointer on how to convert
      es_time_stamp ${ require 'date'; DateTime.parse(__send__('time_stamp')).iso8601(3) }

to use the $record?
      es_time_stamp ${ require 'date'; DateTime.parse('$record["time_stamp"]').iso8601(3) }

I seem to hit an issue on using the $record["time_stamp”] inside a Ruby statement.

- Marco
--
You received this message because you are subscribed to a topic in the Google Groups "Fluentd Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fluentd/XZiWhPPa_gc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fluentd+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Naotoshi Seo

unread,
Jun 8, 2016, 6:18:22 AM6/8/16
to Marco Pas, flu...@googlegroups.com
In your case, it would be like

es_time_stamp ${ require 'date'; DateTime.parse(record["time_stamp"]).iso8601(3) }

since $ is already there.

Marco Pas

unread,
Jun 8, 2016, 9:14:42 AM6/8/16
to Fluentd Google Group, marco....@gmail.com
Thanks a lot!! It worked.
Reply all
Reply to author
Forward
0 new messages