# Make apache.status.uptime.server\_uptime human readable

**URL:** https://discuss.elastic.co/t/make-apache-status-uptime-server-uptime-human-readable/252405
**Category:** Kibana
**Created:** [October 17, 2020, 1:06am UTC](https://discuss.elastic.co/t/make-apache-status-uptime-server-uptime-human-readable/252405 "2020-10-17T01:06:12Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![prophoto](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@prophoto](https://discuss.elastic.co/u/prophoto)
#### Post date: [October 17, 2020, 1:06am UTC](https://discuss.elastic.co/t/make-apache-status-uptime-server-uptime-human-readable/252405/1 "2020-10-17T01:06:12Z")

</div>

How do I convert apache.status.uptime.server\_uptime to human readable format and display it in a Visualization? I've tried multiple times in a scripted field but can't seem to get that to work either. Thanks.

---

<div class="post-metadata">

### Author: ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)
#### Post date: [October 18, 2020, 2:48am UTC](https://discuss.elastic.co/t/make-apache-status-uptime-server-uptime-human-readable/252405/2 "2020-10-18T02:48:04Z")

</div>

Are you getting the value in seconds like from server-status?auto? If so, you should be able to divide by 86400 to get days, or 3600 to get hours.

---

<div class="post-metadata">

### Author: ![Iker](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iker/32/91708_2.png) [@Iker](https://discuss.elastic.co/u/Iker)
#### Post date: [October 18, 2020, 5:44am UTC](https://discuss.elastic.co/t/make-apache-status-uptime-server-uptime-human-readable/252405/3 "2020-10-18T05:44:21Z")

</div>

Try with something like this in the scripted field

`long days = ((doc['field'].value.getMillis()/1000)/86400);`

---

<div class="post-metadata">

### Author: ![prophoto](https://avatars.discourse-cdn.com/v4/letter/p/f6c823/32.png) [@prophoto](https://discuss.elastic.co/u/prophoto)
#### Post date: [October 19, 2020, 12:44pm UTC](https://discuss.elastic.co/t/make-apache-status-uptime-server-uptime-human-readable/252405/4 "2020-10-19T12:44:58Z")

</div>

No idea why but this is working now. This exact code wasn't working the other day haha.

 ![Screen Shot 2020-10-19 at 8.38.09 AM](https://us1.discourse-cdn.com/elastic/original/3X/0/6/0655b187c143643b66f312b06fd80c2e62fd148c.png)

 ![Screen Shot 2020-10-19 at 8.38.22 AM](https://us1.discourse-cdn.com/elastic/original/3X/0/3/0350f97b46bd1d437331364b65cac358eea6762f.png)

 ![Screen Shot 2020-10-19 at 8.40.11 AM](https://us1.discourse-cdn.com/elastic/original/3X/d/0/d01284c0ee56003f2a095e2a87ff90bed0c897f8.png)

Is there any way to make it say "6 days and 2 hours" instead of just "6 Days"? I get "6 days" when I switch "Output Format" to "Human Readable".

 ![Screen Shot 2020-10-19 at 8.40.46 AM](https://us1.discourse-cdn.com/elastic/original/3X/d/d/dd124436b5b7563dda4425dfb22fedc95fdd5bb6.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: [November 16, 2020, 12:45pm UTC](https://discuss.elastic.co/t/make-apache-status-uptime-server-uptime-human-readable/252405/5 "2020-11-16T12:45:03Z")

</div>

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