Im running logstash 5.4 and i need new add_field with sub date string
im trying filter like this
code => "event.set('read_time' , event.get('@timestamp').strftime('%Y-%m'))"
And it is saying '[2017-06-02T02:05:32,867][ERROR][logstash.filters.ruby ] Ruby exception occurred: undefined method `strftime' for 2017-06-02T01:54:11.000Z:LogStash::Timestamp'
What should I do or what im doing wrong
Please help on this.
Thanks in advance.