# Logstash parse object

**URL:** <https://discuss.elastic.co/t/logstash-parse-object/259513>\
**Category:** Logstash\
**Created:** [December 23, 2020, 5:12pm UTC](https://discuss.elastic.co/t/logstash-parse-object/259513 "2020-12-23T17:12:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bbwolf](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bbwolf](https://discuss.elastic.co/u/bbwolf)\
**Post date:** [December 23, 2020, 5:12pm UTC](https://discuss.elastic.co/t/logstash-parse-object/259513/1 "2020-12-23T17:12:35Z")

</div>

Hello,  
I have in a field which I need to split thé next values

```auto
FieldA : "[{" FieldA1" :"A", "FieldA2" :"B"}{"FieldA1" :"C", "FieldA2" :"D"]}"

```

I wan't to split FieldA as two documents

```auto
{" FieldA1" :"A", "FieldA2" :"B"}
{" FieldA1" :"C", "FieldA2" :"D"}

```

Thank you.  
Regards

---

<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:** [December 23, 2020, 5:38pm UTC](https://discuss.elastic.co/t/logstash-parse-object/259513/2 "2020-12-23T17:38:28Z")

</div>

You can use a [split filter](https://www.elastic.co/guide/en/logstash/current/plugins-filters-split.html) to divide an array into multiple events. You can move fields to the top level using [this](https://discuss.elastic.co/t/how-to-dynamically-move-nested-key-value-to-root-level/180006/2).

---

<div class="post-metadata">

**Author:** ![bbwolf](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bbwolf](https://discuss.elastic.co/u/bbwolf)\
**Post date:** [December 23, 2020, 5:54pm UTC](https://discuss.elastic.co/t/logstash-parse-object/259513/4 "2020-12-23T17:54:44Z")

</div>

Thank for your response.  
To use split, objects are comma separated

> results: [  
> { result ... },  
> { result ... },  
> { result ... },  
> ...  
> ]

I don't have this for my values

> results: [  
> { result ... }  
> { result ... }  
> { result ... }  
> ...  
> ]

---

<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:** [December 23, 2020, 5:54pm UTC](https://discuss.elastic.co/t/logstash-parse-object/259513/5 "2020-12-23T17:54:59Z")

</div>

If it is a string rather than an object you could [scan for a regexp](https://discuss.elastic.co/t/parsing-ip-address-coming-at-random-places-inside-logs/259177/5).

---

<div class="post-metadata">

**Author:** ![bbwolf](https://avatars.discourse-cdn.com/v4/letter/b/779978/32.png) [@bbwolf](https://discuss.elastic.co/u/bbwolf)\
**Post date:** [December 23, 2020, 6:13pm UTC](https://discuss.elastic.co/t/logstash-parse-object/259513/7 "2020-12-23T18:13:52Z")

</div>

Thank,  
But I have a big strings. So complex to write regex for this!

---

<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:** [January 20, 2021, 6:14pm UTC](https://discuss.elastic.co/t/logstash-parse-object/259513/8 "2021-01-20T18:14:06Z")

</div>

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