I get a timestamp(6) from an Oracle database with the input-jdbc plugin. This field is converted into Date when I put it in my elastic instance. But I need to have it in the UNIX_MS format (= number of milliseconds since 1st january 1970 - cf. Date filter plugin)!
In other words, I need Date "2018-08-14T09:08:40.764Z" to become "1534237720764" stored in an integer.
Thank you @AquaX, I hadn't think about this possibility to make the conversion in the SQL query. I'm not sure which solution is the best though.
I think the date filter is not necessary in this case. This ruby expression is no more supported with the logstash version I use (6.4.1) :
Ruby exception occurred: Direct event field references (i.e. event['field']) have been disabled in favor of using event get and set methods (e.g. event.get('field'))
Try this then in your input SQL query:
SELECT (CAST(myDate AS DATE) - DATE '1970-01-01')2460601000 + MOD( EXTRACT( SECOND FROM SYSTIMESTAMP ), 1 ) * 1000 FROM DUAL
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.