Parsing an array in Ruby

ruby {
  code => '
    event.get("timestamp").each_with_index { |x, i| event.set( "timestamp1#{i}" , Time.at(x.to_i)) }
  '
}