NickName:Anatoli Ask DateTime:2016-08-22T17:23:01 Converting date to UNIX time in Logstash Is it possible to convert date from "2016-08-22T09:09:55.487Z" format to UNIX time in Logstash? I have seen the opposite operation, but nothing about it. Copyright Notice:Content Author:「Anatoli」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.Link to original article:https://stackoverflow.com/questions/39075736/converting-date-to-unix-time-in-logstash Answers baudsp 2016-08-23T13:27:24 First, you'll have to convert \"2016-08-22T09:09:55.487Z\" to a date object, with the date filter:\n(supposing that the field date contains a string representing a valid ISO8601 timestamp)\n\ndate {\n match => [\"date\", \"ISO8601\"]\n target => \"date_object\"\n}\n\n\nAt this point you'll have a field date_object containing a logstash timestamp. \nThis timestamp can be converted to its epoch equivalent with the to_i method.\nTo do this we'll have to use the ruby filter, which allow to execute ruby code as a filter.\n\nruby { \n code => set.event('date_epoch', event.get('date_object').to_i)\" \n} \n\n\nThen you'll have a field date_epoch, which will be a number representing the UNIX time.",