# Transform to human readable values

**URL:** <https://discuss.elastic.co/t/transform-to-human-readable-values/97289>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [August 16, 2017, 3:20pm UTC](https://discuss.elastic.co/t/transform-to-human-readable-values/97289 "2017-08-16T15:20:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![devans](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devans/32/21073_2.png) [@devans](https://discuss.elastic.co/u/devans)\
**Post date:** [August 16, 2017, 3:20pm UTC](https://discuss.elastic.co/t/transform-to-human-readable-values/97289/1 "2017-08-16T15:20:19Z")

</div>

Is there a way in a transform to convert bytes to human readable format?

I know I can do a painless script to perform math on a byte value, but can I format to show MB or GB depending on size of the value?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 16, 2017, 3:45pm UTC](https://discuss.elastic.co/t/transform-to-human-readable-values/97289/2 "2017-08-16T15:45:36Z")

</div>

Hey,

not really. Elasticsearch has a `ByteSizeValue` class, that is unfortunately not exposed in painless. if you are querying a monitoring API you can use the `human` parameter to get human readable values. Maybe that already helps.

If it's about documents, I would highly recommend doing this on indexing with an ingest processor (still you have to write the logic yourself). Here is some inspiration [https://github.com/elastic/elasticsearch/blob/master/core/src/main/java/org/elasticsearch/common/unit/ByteSizeValue.java](https://github.com/elastic/elasticsearch/blob/master/core/src/main/java/org/elasticsearch/common/unit/ByteSizeValue.java)

--Alex

---

<div class="post-metadata">

**Author:** ![devans](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/devans/32/21073_2.png) [@devans](https://discuss.elastic.co/u/devans)\
**Post date:** [August 16, 2017, 3:49pm UTC](https://discuss.elastic.co/t/transform-to-human-readable-values/97289/3 "2017-08-16T15:49:41Z")

</div>

Thank you. I'm reading from a metricbeat index. I can deal with just always converting to MB. Not really worth the effort to write something.

---

<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:** [September 13, 2017, 3:50pm UTC](https://discuss.elastic.co/t/transform-to-human-readable-values/97289/4 "2017-09-13T15:50:02Z")

</div>

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