Ruby error when replacing @timestamp

Hi,
I need to set the @timestamp field to date contained in another field of my log
(instead of using the default indexation time)
I tried to use the date filter pluging in combination with ruby plugin
Using this code

date {
        match => [ "ts", "yyyyMMddHHmmss" ]
        timezone => "UTC"
        target => "ts_temp"
}

ruby {
        code => "event.set('@timestamp',event.get('ts_temp'))"
}

I get
Ruby exception occurred: wrong argument type NilClass (expected LogStash::Timestamp)

What I'm doing wrong?
Thank you very much
Regards
Anna

My fault, it is not need to use the ruby plugin, just date plugin

date {
        match => [ "ts", "yyyyMMddHHmmss" ]
        timezone => "UTC"
}

Regards
Ana

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.