# How to get json array object size in kibana

**URL:** <https://discuss.elastic.co/t/how-to-get-json-array-object-size-in-kibana/170386>\
**Category:** Elasticsearch\
**Created:** [February 28, 2019, 4:15pm UTC](https://discuss.elastic.co/t/how-to-get-json-array-object-size-in-kibana/170386 "2019-02-28T16:15:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pcrai](https://avatars.discourse-cdn.com/v4/letter/p/c57346/32.png) [@pcrai](https://discuss.elastic.co/u/pcrai)\
**Post date:** [February 28, 2019, 4:15pm UTC](https://discuss.elastic.co/t/how-to-get-json-array-object-size-in-kibana/170386/1 "2019-02-28T16:15:25Z")

</div>

I have given one json log file as input in logstash and getting corresponding mapping in kibana but I want to count element available in json array object. need help to get that.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/6/86783bd832654cf7c70f572e92a75731f862d5f9.png)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 28, 2019, 4:27pm UTC](https://discuss.elastic.co/t/how-to-get-json-array-object-size-in-kibana/170386/2 "2019-02-28T16:27:40Z")

</div>

That's something you should better compute at index time.  
It can be done probably in logstash or in ingest with a script processor.

---

<div class="post-metadata">

**Author:** ![pcrai](https://avatars.discourse-cdn.com/v4/letter/p/c57346/32.png) [@pcrai](https://discuss.elastic.co/u/pcrai)\
**Post date:** [February 28, 2019, 4:54pm UTC](https://discuss.elastic.co/t/how-to-get-json-array-object-size-in-kibana/170386/3 "2019-02-28T16:54:14Z")

</div>

any idea how we can index better in logstash. I am new to ELK so help requested here

---

<div class="post-metadata">

**Author:** ![pcrai](https://avatars.discourse-cdn.com/v4/letter/p/c57346/32.png) [@pcrai](https://discuss.elastic.co/u/pcrai)\
**Post date:** [February 28, 2019, 5:04pm UTC](https://discuss.elastic.co/t/how-to-get-json-array-object-size-in-kibana/170386/4 "2019-02-28T17:04:18Z")

</div>

could you please help me to get better index in logstash

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 28, 2019, 6:05pm UTC](https://discuss.elastic.co/t/how-to-get-json-array-object-size-in-kibana/170386/5 "2019-02-28T18:05:05Z")

</div>

First of all I'd not use logstash just to read a file but filebeat. Then I'd do all the transformation in an ingest pipeline (search in the reference guide for this feature) and I'd use a [painless script processor](https://www.elastic.co/guide/en/elasticsearch/reference/6.6/script-processor.html) to compute this.

If you really want to use logstash, I'd use [https://www.elastic.co/guide/en/logstash/current/plugins-filters-ruby.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-ruby.html)  
If you have more question about logstash you can ask in #logstash room for help.

---

<div class="post-metadata">

**Author:** ![pcrai](https://avatars.discourse-cdn.com/v4/letter/p/c57346/32.png) [@pcrai](https://discuss.elastic.co/u/pcrai)\
**Post date:** [February 28, 2019, 9:38pm UTC](https://discuss.elastic.co/t/how-to-get-json-array-object-size-in-kibana/170386/6 "2019-02-28T21:38:12Z")

</div>

Thanks David.

---

<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:** [March 28, 2019, 9:38pm UTC](https://discuss.elastic.co/t/how-to-get-json-array-object-size-in-kibana/170386/7 "2019-03-28T21:38:15Z")

</div>

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