# Append new information to a field and turn it an array

**URL:** <https://discuss.elastic.co/t/append-new-information-to-a-field-and-turn-it-an-array/87856>\
**Category:** Logstash\
**Created:** [June 1, 2017, 7:51am UTC](https://discuss.elastic.co/t/append-new-information-to-a-field-and-turn-it-an-array/87856 "2017-06-01T07:51:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [June 1, 2017, 7:51am UTC](https://discuss.elastic.co/t/append-new-information-to-a-field-and-turn-it-an-array/87856/1 "2017-06-01T07:51:22Z")

</div>

Is it possible to use logstash to send a list of information into a document's fields and turn it into an array?

Example  
Index name: People  
Type: Eastern  
Document: Country1  
Field: BadPeople  
Values: scammer

can I use logstash to make it into something like this

Example  
Index name: People  
Type: Eastern  
Document: Country1  
Field: BadPeople  
Values: scammer, gangster, prankster, mafia

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [June 4, 2017, 1:49pm UTC](https://discuss.elastic.co/t/append-new-information-to-a-field-and-turn-it-an-array/87856/2 "2017-06-04T13:49:27Z")

</div>

Logstash supports array fields, yes. If you use an `add_field` option to any of Logstash's filter plugins, adding to the same field twice will turn it into an array field.

---

<div class="post-metadata">

**Author:** ![gringo](https://avatars.discourse-cdn.com/v4/letter/g/f19dbf/32.png) [@gringo](https://discuss.elastic.co/u/gringo)\
**Post date:** [June 12, 2017, 3:00am UTC](https://discuss.elastic.co/t/append-new-information-to-a-field-and-turn-it-an-array/87856/3 "2017-06-12T03:00:09Z")

</div>

Base on the previous example. How can I use logstash to parse the following to get the desired result?

**Raw Text in Text File**  
scammer  
gangster  
prankster  
mafia

**Desired End Result**  
Index name: People  
Type: Eastern  
Document: Country1  
Field: BadPeople  
Values: scammer, gangster, prankster, mafia

---

<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 10, 2017, 3:00am UTC](https://discuss.elastic.co/t/append-new-information-to-a-field-and-turn-it-an-array/87856/4 "2017-07-10T03:00:10Z")

</div>

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