Strftime is not working Logshtash ruby code

The LogStash::Timestamp class has a time method.

Try...

ruby {
code => "event.set('read_time' , event.get('@timestamp').time.strftime('%Y-%m'))"
}
2 Likes