# How to visualize JSON array in Kibana

**URL:** <https://discuss.elastic.co/t/how-to-visualize-json-array-in-kibana/145260>\
**Category:** Kibana\
**Created:** [August 20, 2018, 11:19pm UTC](https://discuss.elastic.co/t/how-to-visualize-json-array-in-kibana/145260 "2018-08-20T23:19:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![obaid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/obaid/32/34653_2.png) [@obaid](https://discuss.elastic.co/u/obaid)\
**Post date:** [August 20, 2018, 11:19pm UTC](https://discuss.elastic.co/t/how-to-visualize-json-array-in-kibana/145260/1 "2018-08-20T23:19:43Z")

</div>

**Context:**  
I have my application logs on ELK, where JSON API response looks like:

```
Response 1: 

    {
      "rules" : [
        {"name" : "R1", "value" : "Y"},
        {"name" : "R2", "value" : "Y"},
        {"name" : "R3", "value" : "Y"}
        ]
    }

Response 2: 

    {
      "rules" : [
        {"name" : "R1", "value" : "N"},
        {"name" : "R2", "value" : "Y"},
        {"name" : "R3", "value" : "N"}
      ]
   }

```

My API is actually running rules, and it return response of each rule in the form of Y (rule passed) and N (rule failed). For example, above Response 1 shows R1 R2 and R3 all passed, where in Response 2 R1 and R3 failed.

**Question**  
How do I plot the count of each rule with value 'Y' ?  
Scripted Fields dont work since they return just one value, however here we have multiple Rule names?

Thanks  
Obaid

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [August 21, 2018, 9:12pm UTC](https://discuss.elastic.co/t/how-to-visualize-json-array-in-kibana/145260/2 "2018-08-21T21:12:26Z")

</div>

Whenever you use objects inside of arrays, it doesn't really play well with Kibana. You'll have a lot more luck if you create a separate `rules` index, and index each of the objects inside `rules` separately. Then you'd easily be able to create a visualization like you've mentioned.

---

<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:** [September 18, 2018, 9:23pm UTC](https://discuss.elastic.co/t/how-to-visualize-json-array-in-kibana/145260/3 "2018-09-18T21:23:41Z")

</div>

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