# Splitting the data in logstash

**URL:** <https://discuss.elastic.co/t/splitting-the-data-in-logstash/249404>\
**Category:** Logstash\
**Created:** [September 21, 2020, 6:00pm UTC](https://discuss.elastic.co/t/splitting-the-data-in-logstash/249404 "2020-09-21T18:00:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![subash](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/subash/32/59912_2.png) [@subash](https://discuss.elastic.co/u/subash)\
**Post date:** [September 21, 2020, 6:00pm UTC](https://discuss.elastic.co/t/splitting-the-data-in-logstash/249404/1 "2020-09-21T18:00:29Z")

</div>

I have a field 'brief' in the below format.

"brief": [  
{rx-usage: 0.0,  
tx-stats: {tx-errors: 0, tx-bytes: 3597278194, tx-bps: 1808, tx-pps: 3, tx-packets: 8620093},  
name: vni-0/0, host-inf: eth1, if-oper-status: up,  
rx-stats: {rx-packets: 1088458, rx-pps: 2, rx-bps: 1392, rx-errors: 0, rx-bytes: 67069272},  
tx-usage: 0.0},

{rx-usage: 0.0,  
tx-stats: {tx-errors: 0, tx-bytes: 2105140374, tx-bps: 14464, tx-pps: 11, tx-packets: 12370683},  
name: vni-0/1, host-inf: eth2, if-oper-status: up,  
rx-stats: {rx-packets: 19948899, rx-pps: 9, rx-bps: 12760, rx-errors: 0, rx-bytes: 6312190688}, tx-usage: 0.0}  
]

I try to have the following.

"brief"=[  
{rx-usage: 0.0,  
tx-stats: {tx-errors: 0, tx-bytes: 3597278194, tx-bps: 1808, tx-pps: 3, tx-packets: 8620093},  
name: vni-0/0, host-inf: eth1, if-oper-status: up,  
rx-stats: {rx-packets: 1088458, rx-pps: 2, rx-bps: 1392, rx-errors: 0, rx-bytes: 67069272},  
tx-usage: 0.0}]

"brief"=[  
{rx-usage: 0.0,  
tx-stats: {tx-errors: 0, tx-bytes: 3597278194, tx-bps: 1808, tx-pps: 3, tx-packets: 8620093},  
name: vni-0/0, host-inf: eth1, if-oper-status: up,  
rx-stats: {rx-packets: 1088458, rx-pps: 2, rx-bps: 1392, rx-errors: 0, rx-bytes: 67069272},  
tx-usage: 0.0}]

please help to split the data?

Thanks in Advance

---

<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:** [September 21, 2020, 7:32pm UTC](https://discuss.elastic.co/t/splitting-the-data-in-logstash/249404/2 "2020-09-21T19:32:23Z")

</div>

If you are saying you want to split an array into one event for each value in the array then use a [split](https://www.elastic.co/guide/en/logstash/current/plugins-filters-split.html) filter.

---

<div class="post-metadata">

**Author:** ![subash](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/subash/32/59912_2.png) [@subash](https://discuss.elastic.co/u/subash)\
**Post date:** [September 22, 2020, 3:20am UTC](https://discuss.elastic.co/t/splitting-the-data-in-logstash/249404/3 "2020-09-22T03:20:41Z")

</div>

@badger when I use split filter, it is saying "Only String and Array types are splittable. field:[brief] is of type = NilClass"

split{  
field =\> "[brief]"  
}

---

<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:** [September 22, 2020, 2:46pm UTC](https://discuss.elastic.co/t/splitting-the-data-in-logstash/249404/4 "2020-09-22T14:46:03Z")

</div>

That is telling you that the field does not exist on some events.

---

<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:** [October 20, 2020, 2:46pm UTC](https://discuss.elastic.co/t/splitting-the-data-in-logstash/249404/5 "2020-10-20T14:46:23Z")

</div>

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