# Scriptting in Json Input Problem

**URL:** <https://discuss.elastic.co/t/scriptting-in-json-input-problem/56075>\
**Category:** Kibana\
**Created:** [July 21, 2016, 8:42am UTC](https://discuss.elastic.co/t/scriptting-in-json-input-problem/56075 "2016-07-21T08:42:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kennedy\_Kan1](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Kennedy\_Kan1](https://discuss.elastic.co/u/Kennedy_Kan1)\
**Post date:** [July 21, 2016, 8:42am UTC](https://discuss.elastic.co/t/scriptting-in-json-input-problem/56075/1 "2016-07-21T08:42:49Z")

</div>

I am trying topbeat with ES and Kibana 5.0 Alpha 4. When I display result in the visualization, for example, it didnt turn my figure from bytes to Gb as the past version. Here shows the example.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/0/024ebf8cf302bdec963c1502f46e19d6839a628d.png)

The disk space are all in bytes. What json input can I write to make it turn from bytes to Gb or is there other ways of doing it?

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [July 21, 2016, 4:35pm UTC](https://discuss.elastic.co/t/scriptting-in-json-input-problem/56075/2 "2016-07-21T16:35:50Z")

</div>

You can use an inline script:

```auto
{
  "script" : {
    "inline" : "doc['fs.total'].value / 1024",
    "lang" : "painless"
  }
}

```

---

<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:** [July 21, 2016, 7:19pm UTC](https://discuss.elastic.co/t/scriptting-in-json-input-problem/56075/3 "2016-07-21T19:19:07Z")

</div>

You can also create a scripted field like `diskspaceKB` and/or `diskspaceMB` in the settings tab. Select your index pattern, then go to the scripted fields tab. Then Add Scripted field button. There's some instructions on that page.

---

<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 6, 2017, 1:44pm UTC](https://discuss.elastic.co/t/scriptting-in-json-input-problem/56075/4 "2017-07-06T13:44:50Z")

</div>


