I'm new to fluentd and using it to ingest data to elasticsearch. I have a field called request_time which has value : 110820120501 as a number of the format [ddmmyyHHMMSS]. How can I convert this as a date field.
This is what I've written but it doesn't work. Any help is appreciated.
Example request_time value : 100820015642
<filter>
@type record_transformer
enable_ruby true
<record>
request_time ${ require 'date'; DateTime.strptime('request_time', '%d%m%y%H%M%S')}
</record>
</filter>
I have tried the below as well:
<filter>
@type record_transformer
enable_ruby true
<record>
time ${require 'date'; DateTime.parse('request_time').strftime('%d%m%y%H%M%S')}
</record>
</filter>
How can I store request_time as a date field coverted to a value as eg. "request_time": "2020-08-11T11:24:23.000+0100" ?