# Kibana JSON inpus

**URL:** <https://discuss.elastic.co/t/kibana-json-inpus/317276>\
**Category:** Kibana\
**Tags:** painless\
**Created:** [October 23, 2022, 2:23pm UTC](https://discuss.elastic.co/t/kibana-json-inpus/317276 "2022-10-23T14:23:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChristianOelsner](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@ChristianOelsner](https://discuss.elastic.co/u/ChristianOelsner)\
**Post date:** [October 23, 2022, 2:23pm UTC](https://discuss.elastic.co/t/kibana-json-inpus/317276/1 "2022-10-23T14:23:47Z")

</div>

Hello forum,

I am trying to present some metrics in byte or even better gigabytes in a Data table visualization.  
I am unable to edit the index-pattern, but i can see that it is mapped as a long.  
I am trying to have the value displayed as gigabytes using JSON input.

```auto
{
  "script": {
    "inline": "doc['prometheus.confluent_kafka_server_retained_bytes.value'].value <insert formula here>",
    "lang": "painless"
  }
}

```

Anyone here how i would make that happen?

Best regards  
Christian Oelsner

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 23, 2022, 3:24pm UTC](https://discuss.elastic.co/t/kibana-json-inpus/317276/2 "2022-10-23T15:24:07Z")

</div>

You most likely do not a script for this

First.

What version of Kibana / Elasticsearch?

What visualization? Lens?

a) In general you can set the format in the Index Pattern / Data View and that will take affect everywhere

 ![Screen Shot 2022-10-23 at 9.31.53 AM](https://us1.discourse-cdn.com/elastic/original/3X/0/5/05eec83c0c55260a63aad2214f9e06ce276b42a6.jpeg)

Or B) In Lens set the formatting..

 ![Screen Shot 2022-10-23 at 9.39.09 AM](https://us1.discourse-cdn.com/elastic/original/3X/1/0/10dbac6d6e5c6b3b36968e4f93bdb6337f1894c3.png)

---

<div class="post-metadata">

**Author:** ![ChristianOelsner](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@ChristianOelsner](https://discuss.elastic.co/u/ChristianOelsner)\
**Post date:** [October 24, 2022, 2:44am UTC](https://discuss.elastic.co/t/kibana-json-inpus/317276/3 "2022-10-24T02:44:12Z")

</div>

> [@stephenb](#):
>
> What version of Kibana / Elasticsearch?

Hi Stephen,  
Thanks for taking your time to reply 🙂  
The version is 8.3.3.

I do not have permissions to set the format in the index pattern, which is why i am looking for alternatives 🙂  
Though i did talk to the one in charge of the Observability department today and he suggested that he could grant me those priviliedges on their dev cluster.  
But for now, i do not have that access.

I am using an aggregation based data table visualization.

Some background is that i am trying to create a visualisation that our application teams can go to and see the cost for them to use Confluent Cloud, in this example, how much they will be billed for reatained bytes.

Regards  
Christian Oelsner

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [October 24, 2022, 3:30am UTC](https://discuss.elastic.co/t/kibana-json-inpus/317276/4 "2022-10-24T03:30:17Z")

</div>

Try a table in Lens, you can set the format for each column as I showed above...

 ![Screen Shot 2022-10-23 at 8.46.32 PM](https://us1.discourse-cdn.com/elastic/original/3X/1/9/19a4d1dba09a4f853d75c63d4b17b4fb621823c4.jpeg)

You could even use the formula to multiply the bytes by a cost and provide an estimated cost column

 ![Screen Shot 2022-10-23 at 8.52.35 PM](https://us1.discourse-cdn.com/elastic/original/3X/5/8/58fdbcfd90816a4e0cccf28c67a74abfa7c45466.png)

---

<div class="post-metadata">

**Author:** ![ChristianOelsner](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@ChristianOelsner](https://discuss.elastic.co/u/ChristianOelsner)\
**Post date:** [October 24, 2022, 4:23am UTC](https://discuss.elastic.co/t/kibana-json-inpus/317276/5 "2022-10-24T04:23:21Z")

</div>

Good morning Stephen,  
This is good stuff, i will be sure to try that out and report back here.

Regards  
Christian Oelsner

---

<div class="post-metadata">

**Author:** ![ChristianOelsner](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@ChristianOelsner](https://discuss.elastic.co/u/ChristianOelsner)\
**Post date:** [October 24, 2022, 7:05am UTC](https://discuss.elastic.co/t/kibana-json-inpus/317276/6 "2022-10-24T07:05:43Z")

</div>

Hi again Stephen,  
Your suggestion worked beautifully 🙂

Thank you so much for your input.

Best regards  
Christian Oelsner

---

<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 21, 2022, 7:06am UTC](https://discuss.elastic.co/t/kibana-json-inpus/317276/7 "2022-11-21T07:06:41Z")

</div>

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