# How to implment compound query in kibana

**URL:** <https://discuss.elastic.co/t/how-to-implment-compound-query-in-kibana/46396>\
**Category:** Kibana\
**Created:** [April 5, 2016, 1:15pm UTC](https://discuss.elastic.co/t/how-to-implment-compound-query-in-kibana/46396 "2016-04-05T13:15:54Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![LeeDr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leedr/32/9289_2.png) [@LeeDr](https://discuss.elastic.co/u/LeeDr)\
**Post date:** [April 6, 2016, 8:33pm UTC](https://discuss.elastic.co/t/how-to-implment-compound-query-in-kibana/46396/4 "2016-04-06T20:33:21Z")

</div>

On your My\_Test\_VIZ issue, you say you have the first and third step but need the second. And the second step is to find ONLY the tests where the latest result is failed. I'm not sure that's possible. Or maybe only with the custom JSON scripting. At the bottom of the Split Rows aggregation, click the Advanced link and you should see the "JSON Input" field.

I don't know much about using this JSON scripting myself, but I found one example here; [Display concurrency in data on Kibana](https://discuss.elastic.co/t/display-concurrency-in-data-on-kibana/26006/13)

You can't do any of this aggregation in Discover.

Regards,  
Lee

---

_[View the full topic](https://discuss.elastic.co/t/how-to-implment-compound-query-in-kibana/46396)._
