# Logstash 2.3 custom array fields

**URL:** <https://discuss.elastic.co/t/logstash-2-3-custom-array-fields/45856>\
**Category:** Logstash\
**Created:** [March 30, 2016, 11:07pm UTC](https://discuss.elastic.co/t/logstash-2-3-custom-array-fields/45856 "2016-03-30T23:07:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wal](https://avatars.discourse-cdn.com/v4/letter/w/d6d6ee/32.png) [@wal](https://discuss.elastic.co/u/wal)\
**Post date:** [March 30, 2016, 11:07pm UTC](https://discuss.elastic.co/t/logstash-2-3-custom-array-fields/45856/1 "2016-03-30T23:07:19Z")

</div>

Hi,

When upgrading to 2.3 I have lost the ability to create a custom array field example

```
filter {
      ruby {
        code =>"
          event['custom'] ||= []
          event['custom] << 'test' unless event['custom'].include?('test')
          event.tag('test')
        "
      }
}

```

Output

```
{
    "@timestamp" => 2016-03-30T23:03:32.537Z,
        **"custom" => [],**
      "@version" => "1",
          "host" => "localhost.localdomain",
       "message" => "test",
          "tags" => [
        [0] "_jsonparsefailure",
        [1] "test"
    ]
}

```

When I have not used \<\< and created an array and just assigned event['custom'] it works okay

Thanks  
Wal

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:04am UTC](https://discuss.elastic.co/t/logstash-2-3-custom-array-fields/45856/2 "2017-07-06T05:04:40Z")

</div>


