# Parsing an array in Ruby

**URL:** https://discuss.elastic.co/t/parsing-an-array-in-ruby/121254
**Category:** Logstash
**Created:** [February 23, 2018, 4:44pm UTC](https://discuss.elastic.co/t/parsing-an-array-in-ruby/121254 "2018-02-23T16:44:36Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [February 23, 2018, 5:38pm UTC](https://discuss.elastic.co/t/parsing-an-array-in-ruby/121254/2 "2018-02-23T17:38:23Z")

</div>

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

```

---

_[View the full topic](https://discuss.elastic.co/t/parsing-an-array-in-ruby/121254)._
