# Logstash convert data from array list to objects

**URL:** <https://discuss.elastic.co/t/logstash-convert-data-from-array-list-to-objects/186978>\
**Category:** Logstash\
**Created:** [June 23, 2019, 2:13am UTC](https://discuss.elastic.co/t/logstash-convert-data-from-array-list-to-objects/186978 "2019-06-23T02:13:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arash\_moosavi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arash_moosavi/32/48587_2.png) [@arash\_moosavi](https://discuss.elastic.co/u/arash_moosavi)\
**Post date:** [June 23, 2019, 2:13am UTC](https://discuss.elastic.co/t/logstash-convert-data-from-array-list-to-objects/186978/1 "2019-06-23T02:13:49Z")

</div>

I send following data to Logstash:

```auto
{
"a": 1,
"b": 2,
"c": 3,
"d": {
      ["key": "felan", "value": 123], ["key": "bahman", "value":321]
    }
}

```

I want to convert it to:

```auto
{
"a": 1,
"b": 2,
"c": 3,
"d": {
      "felan": 123, 
      "bahman": 321
    }
}

```

How should I write the filter in Logstash?

---

<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:** [June 23, 2019, 9:41am UTC](https://discuss.elastic.co/t/logstash-convert-data-from-array-list-to-objects/186978/2 "2019-06-23T09:41:02Z")

</div>

You will need something like [this](https://discuss.elastic.co/t/solved-split-filter-question-a-k-a-flatten-json-sub-array/130481/12).

---

<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 21, 2019, 9:41am UTC](https://discuss.elastic.co/t/logstash-convert-data-from-array-list-to-objects/186978/3 "2019-07-21T09:41:05Z")

</div>

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