# Jenkins Logstash plugin to show current state of all jobs in one Kibana graph

**URL:** <https://discuss.elastic.co/t/jenkins-logstash-plugin-to-show-current-state-of-all-jobs-in-one-kibana-graph/136562>\
**Category:** Kibana\
**Created:** [June 19, 2018, 7:56pm UTC](https://discuss.elastic.co/t/jenkins-logstash-plugin-to-show-current-state-of-all-jobs-in-one-kibana-graph/136562 "2018-06-19T19:56:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ps895r](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@ps895r](https://discuss.elastic.co/u/ps895r)\
**Post date:** [June 19, 2018, 7:56pm UTC](https://discuss.elastic.co/t/jenkins-logstash-plugin-to-show-current-state-of-all-jobs-in-one-kibana-graph/136562/1 "2018-06-19T19:56:01Z")

</div>

This question is regarding Jenkins, the use of their logstash plugin to send build logs to elasticsearch and how to get the current state of all jobs. For example, let's say there are 10 jobs. I'd like to generate a graph to show how many of those are currently failing/passing using the latest build number for each job (not sure if that's the best to look at). I can currently get the latest result for individual jobs using the top hit aggregation, but I'm trying to avoid having to create a unique graph for every job. Does anyone know how I can accomplish getting all jobs to show their current state (success/failure) in just one graph (7 jobs most recently passed and 3 failed)?

---

<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:** [June 19, 2018, 9:47pm UTC](https://discuss.elastic.co/t/jenkins-logstash-plugin-to-show-current-state-of-all-jobs-in-one-kibana-graph/136562/2 "2018-06-19T21:47:51Z")

</div>

You could try something like this...

I created a `Data Table` visualization. My first metric is Max @timestamp  
For the Bucket aggregation I used a Terms aggregation on extension.raw, but you would use the Jenkins job name I think.  
And the I created another metric for `Top Hit` on agent.keyword, but here you would use the field that represents the status of Jenkins job.

I _think_ this would show you the latest status of each job, but please verify with your data before you trust that I did this correctly.

Regards,  
Lee

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/7/07159ab67d9e45ed20ed9952a00fe0baeb0fa17d.png)

---

<div class="post-metadata">

**Author:** ![ps895r](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@ps895r](https://discuss.elastic.co/u/ps895r)\
**Post date:** [June 20, 2018, 2:26pm UTC](https://discuss.elastic.co/t/jenkins-logstash-plugin-to-show-current-state-of-all-jobs-in-one-kibana-graph/136562/3 "2018-06-20T14:26:36Z")

</div>

That's exactly what I needed! Thank you for the help. I had been banging my head against the wall trying to do this with a pie chart. I still can't figure it out with that kind of chart, but the data table did the trick.

---

<div class="post-metadata">

**Author:** ![ps895r](https://avatars.discourse-cdn.com/v4/letter/p/ce73a5/32.png) [@ps895r](https://discuss.elastic.co/u/ps895r)\
**Post date:** [June 20, 2018, 6:22pm UTC](https://discuss.elastic.co/t/jenkins-logstash-plugin-to-show-current-state-of-all-jobs-in-one-kibana-graph/136562/4 "2018-06-20T18:22:42Z")

</div>

I just came up with one other enhancement question. I haven't been able to figure it out so far, but is there then a way to let's say count up the number of jobs currently set to success and then count up the ones currently set to failure? I've tried adding counts, but it just seems to add up the total number for each build.

---

<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:** [July 18, 2018, 6:22pm UTC](https://discuss.elastic.co/t/jenkins-logstash-plugin-to-show-current-state-of-all-jobs-in-one-kibana-graph/136562/5 "2018-07-18T18:22:48Z")

</div>

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