# Display count of tomcat down -metric visualization

**URL:** https://discuss.elastic.co/t/display-count-of-tomcat-down-metric-visualization/299477
**Category:** Kibana
**Created:** [March 11, 2022, 4:03pm UTC](https://discuss.elastic.co/t/display-count-of-tomcat-down-metric-visualization/299477 "2022-03-11T16:03:01Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![PRASHANT\_MEHTA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_mehta/32/101764_2.png) [@PRASHANT\_MEHTA](https://discuss.elastic.co/u/PRASHANT_MEHTA)
#### Post date: [March 11, 2022, 4:03pm UTC](https://discuss.elastic.co/t/display-count-of-tomcat-down-metric-visualization/299477/1 "2022-03-11T16:03:01Z")

</div>

Trying to create a visulization in kibana that should only display no of tomcat which are down.  
I guess I'm using wrong aggregation and not getting exactly wht can help out here.  
'''''''''''''''''  
logs:  
Filelds:  
1)tomcat.host\_name:kpti001,kpti002..etc  
2)tomcat.server\_status : "UP" or "Down" Value  
'''''''''''''''''''  
Issue: when tomcat goes down the count shows correct and updates on visualization,ex 2 tomcat down--metric shows "2",but when server is up it takes 15 min to show current status of UP.  
The timefilter is 15 min,but refresh is set 10 s,still not getting how come its updating the value after 15 min,though in discover index the status comes up immediately as "UP".I guess the Unique count and count aggregation are causing it but wht could solve this,any diff aggregation?

Thanks,  
Prashant

 ![M3](https://us1.discourse-cdn.com/elastic/original/3X/b/c/bc5a508833a3679804e8f445aede04dae295d556.png)

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [March 14, 2022, 1:01pm UTC](https://discuss.elastic.co/t/display-count-of-tomcat-down-metric-visualization/299477/2 "2022-03-14T13:01:03Z")

</div>

Hi @PRASHANT_MEHTA. I believe you only want to check the latest status of the Tomcat server. So you might try settings your Metrics to Top Hit on the @timestamp field.

---

<div class="post-metadata">

### Author: ![PRASHANT\_MEHTA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_mehta/32/101764_2.png) [@PRASHANT\_MEHTA](https://discuss.elastic.co/u/PRASHANT_MEHTA)
#### Post date: [March 14, 2022, 2:07pm UTC](https://discuss.elastic.co/t/display-count-of-tomcat-down-metric-visualization/299477/3 "2022-03-14T14:07:53Z")

</div>

## hello @nickpeihl ,thanks for looking into this,I want the total count of tomcat that are down. Ex:Server 1-Tomcat1,Server 2-Tomcat 2...Server n Tomcat n,Now suppose out of active 25 tomcat,5 tomcat goes down so I want 5 to be displayed real time i.e current status.I did tried the Top hit earlier but it didn't worked.Just want the count of host that are presently down.This is something admin will check for real time to check the status.Any suggestion would be helpful. Sample Logs Image: tomcat.server\_status: "UP" or "Down" tomcat.tomcat.host\_name:td06app1001,td02app1002,td03app1003... Kibana 7.9.1

 ![SEVERAL_HOST_STATUS](https://us1.discourse-cdn.com/elastic/original/3X/9/8/98b8b14b2d987ef54dfc58db13e73c2a776a8b0d.png)

---

<div class="post-metadata">

### Author: ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)
#### Post date: [March 14, 2022, 2:30pm UTC](https://discuss.elastic.co/t/display-count-of-tomcat-down-metric-visualization/299477/4 "2022-03-14T14:30:31Z")

</div>

Hi again @PRASHANT_MEHTA. I believe you need to have a terms query for the top hit (on `@timestamp`) for each server then count the results. You might want to use the advanced features of [TSVB](https://www.elastic.co/guide/en/kibana/current/tsvb.html) for that.

---

<div class="post-metadata">

### Author: ![PRASHANT\_MEHTA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_mehta/32/101764_2.png) [@PRASHANT\_MEHTA](https://discuss.elastic.co/u/PRASHANT_MEHTA)
#### Post date: [March 14, 2022, 3:45pm UTC](https://discuss.elastic.co/t/display-count-of-tomcat-down-metric-visualization/299477/5 "2022-03-14T15:45:44Z")

</div>

@nickpeihl Thanx for your quick response!! 😃,I achieved the desired result.Many Thanx.

 ![tomcat_server_down_count](https://us1.discourse-cdn.com/elastic/original/3X/c/4/c46bc23d44554fd1d7422f53043987107021c8da.png)

---

<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: [April 11, 2022, 3:46pm UTC](https://discuss.elastic.co/t/display-count-of-tomcat-down-metric-visualization/299477/6 "2022-04-11T15:46:09Z")

</div>

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