# Split bars on visualisation by using custom query

**URL:** https://discuss.elastic.co/t/split-bars-on-visualisation-by-using-custom-query/138411
**Category:** Kibana
**Created:** [July 3, 2018, 2:48pm UTC](https://discuss.elastic.co/t/split-bars-on-visualisation-by-using-custom-query/138411 "2018-07-03T14:48:02Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![byakku](https://avatars.discourse-cdn.com/v4/letter/b/f17d59/32.png) [@byakku](https://discuss.elastic.co/u/byakku)
#### Post date: [July 3, 2018, 2:48pm UTC](https://discuss.elastic.co/t/split-bars-on-visualisation-by-using-custom-query/138411/1 "2018-07-03T14:48:02Z")

</div>

Hello everyone.

I have two folders in my source (using wildcards) and I have created visualisation based on this.

The big picture is that, I'm visualising amount of errors/failed builds from Jenkins log, now I want to be more specific and I want to split bars into specific reasons of failures.

I have a query with visualisation for total count of failed builds and I have query with visualisation for specific errors that makes the build fail.

I want to aggregate them into bars and visualise total amount of builds and amount of specific errors that caused build to fail, with daily timestamp.

Example below

![kibana_example](https://us1.discourse-cdn.com/elastic/original/3X/f/d/fd4f85420283680a1329a99f0d9613108ffb8b9e.png)

I can't find proper option in 'Split series'. Could someone guide me through that or give some advices where to start or if it's even possible?

> **[Screenshot](https://prnt.sc/k22l4w)**
>
> Captured with Lightshot

Greetings

---

<div class="post-metadata">

### Author: ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)
#### Post date: [July 3, 2018, 6:39pm UTC](https://discuss.elastic.co/t/split-bars-on-visualisation-by-using-custom-query/138411/2 "2018-07-03T18:39:23Z")

</div>

You're so close, you probably want to scroll down the aggregation list a bit and choose the "terms" aggregation for splitting your bars based on the field that indicates what the cause for the error is.

---

<div class="post-metadata">

### Author: ![byakku](https://avatars.discourse-cdn.com/v4/letter/b/f17d59/32.png) [@byakku](https://discuss.elastic.co/u/byakku)
#### Post date: [July 4, 2018, 1:04pm UTC](https://discuss.elastic.co/t/split-bars-on-visualisation-by-using-custom-query/138411/3 "2018-07-04T13:04:11Z")

</div>

I have no correct term displayed there.

I'm clicking Add sub-buckets, Split Series, then I can select aggregation but nothing from Terms matches my needs.

Visualisation is based on simple query that counts all log entries and that's all, maybe I missed some particular step?

---

<div class="post-metadata">

### Author: ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)
#### Post date: [July 4, 2018, 10:16pm UTC](https://discuss.elastic.co/t/split-bars-on-visualisation-by-using-custom-query/138411/4 "2018-07-04T22:16:40Z")

</div>

If you scroll here, you don’t see “Terms” under “Significant Terms”?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/1/218e8695a9d0c18beeaf0b75f33e22839fccdc3a.jpeg)

---

<div class="post-metadata">

### Author: ![byakku](https://avatars.discourse-cdn.com/v4/letter/b/f17d59/32.png) [@byakku](https://discuss.elastic.co/u/byakku)
#### Post date: [July 5, 2018, 1:44pm UTC](https://discuss.elastic.co/t/split-bars-on-visualisation-by-using-custom-query/138411/5 "2018-07-05T13:44:23Z")

</div>

I can pick Terms but I have preconfigured terms there.

> **[Screenshot](https://prnt.sc/k2w6xr)**
>
> Captured with Lightshot

My visualisation is based on query

`source:*CLOUD* AND "Finished: FAILURE"`

but when I do

`source:*CLOUD* AND "docker prune -f"`

I ALSO have listed failed builds but only these failed by docker error, ergo bars are showing lets say 10% of error that are shown in previous query. I don't see a proper field that, so I have no clue how to go further with this, despite that it's super basic problem. 😕

---

<div class="post-metadata">

### Author: ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)
#### Post date: [July 5, 2018, 3:37pm UTC](https://discuss.elastic.co/t/split-bars-on-visualisation-by-using-custom-query/138411/6 "2018-07-05T15:37:37Z")

</div>

I’m sorry, I’m not sure I understand, but if you’re trying to define the splits with individual queries that you can use the “Filters” bucket aggregation time

---

<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: [August 2, 2018, 3:44pm UTC](https://discuss.elastic.co/t/split-bars-on-visualisation-by-using-custom-query/138411/7 "2018-08-02T15:44:56Z")

</div>

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