# Kibana JSON input Script

**URL:** <https://discuss.elastic.co/t/kibana-json-input-script/108590>\
**Category:** Kibana\
**Created:** [November 21, 2017, 4:31pm UTC](https://discuss.elastic.co/t/kibana-json-input-script/108590 "2017-11-21T16:31:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![k2xl](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@k2xl](https://discuss.elastic.co/u/k2xl)\
**Post date:** [November 21, 2017, 4:31pm UTC](https://discuss.elastic.co/t/kibana-json-input-script/108590/1 "2017-11-21T16:31:54Z")

</div>

Hi,

I have three fields:  
beat.hostname  
customer  
site

I'd like to have it so that kibana visualization groups by hostname, but the display on the legend is customer+"."+site

How can I do this?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [November 21, 2017, 7:39pm UTC](https://discuss.elastic.co/t/kibana-json-input-script/108590/2 "2017-11-21T19:39:34Z")

</div>

Sorry, there isn't really a way to do this in Kibana.

In 6.1, there will be a new feature in Timelion that makes it aware of scripted fields. Assuming your data is a time series, and Timelion is suitable to visualize your data, you could make a scripted field that's a concatenation of these 2 fields, and then make a split on the scripted field. Then you can customize the label based on the groups in the split.

Here's the PR going into 6.1 that provides the new feature: [https://github.com/elastic/kibana/pull/14700](https://github.com/elastic/kibana/pull/14700)

---

<div class="post-metadata">

**Author:** ![k2xl](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@k2xl](https://discuss.elastic.co/u/k2xl)\
**Post date:** [November 21, 2017, 7:52pm UTC](https://discuss.elastic.co/t/kibana-json-input-script/108590/3 "2017-11-21T19:52:40Z")

</div>

Are you sure? Why is there a scripted field under split series panel?

---

<div class="post-metadata">

**Author:** ![k2xl](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@k2xl](https://discuss.elastic.co/u/k2xl)\
**Post date:** [November 21, 2017, 8:19pm UTC](https://discuss.elastic.co/t/kibana-json-input-script/108590/4 "2017-11-21T20:19:31Z")

</div>

I was actually able to do it! Using scripted\_fields, added one called Friendly Name  
doc["site"].value+' '+doc["beat.hostname"].value String

Note it may take time for cluster to finish creating it for all the documents, at least it took ours a few minutes

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [November 21, 2017, 9:49pm UTC](https://discuss.elastic.co/t/kibana-json-input-script/108590/5 "2017-11-21T21:49:25Z")

</div>

Ah, so you updated all your documents with a new field using a script? That's going to be the most performant way to handle it at search time.

---

<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:** [December 19, 2017, 9:49pm UTC](https://discuss.elastic.co/t/kibana-json-input-script/108590/6 "2017-12-19T21:49:28Z")

</div>

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