# Alias on bar chart

**URL:** <https://discuss.elastic.co/t/alias-on-bar-chart/125357>\
**Category:** Kibana\
**Created:** [March 23, 2018, 11:17am UTC](https://discuss.elastic.co/t/alias-on-bar-chart/125357 "2018-03-23T11:17:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![br14nb0](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/br14nb0/32/28814_2.png) [@br14nb0](https://discuss.elastic.co/u/br14nb0)\
**Post date:** [March 23, 2018, 11:17am UTC](https://discuss.elastic.co/t/alias-on-bar-chart/125357/1 "2018-03-23T11:17:18Z")

</div>

Hello, I have a bar chart in the picture. But the value of the fields I want to show on the chart is a long name. How can I make an alias for it ? Thanks

![Untitled](https://us1.discourse-cdn.com/elastic/original/3X/8/3/83d246d8b35212579c9f63a9381b1852c494b1f7.png)

---

<div class="post-metadata">

**Author:** ![chrisronline](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrisronline/32/28230_2.png) [@chrisronline](https://discuss.elastic.co/u/chrisronline)\
**Post date:** [March 23, 2018, 3:22pm UTC](https://discuss.elastic.co/t/alias-on-bar-chart/125357/2 "2018-03-23T15:22:29Z")

</div>

Hi @br14nb0,

You can try creating a scripted field and shortening or aliasing the value manually there.

See this article: [https://www.elastic.co/guide/en/kibana/current/scripted-fields.html](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html)

---

<div class="post-metadata">

**Author:** ![br14nb0](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/br14nb0/32/28814_2.png) [@br14nb0](https://discuss.elastic.co/u/br14nb0)\
**Post date:** [March 25, 2018, 7:58am UTC](https://discuss.elastic.co/t/alias-on-bar-chart/125357/3 "2018-03-25T07:58:24Z")

</div>

I mean I want to shorten the value of the field not the name of the field. Like shown in the picture, I just want to get the last string Taskmg.exe, regedit.exe,..etc. Anyway to use something like parse or regex ?

---

<div class="post-metadata">

**Author:** ![chrisronline](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrisronline/32/28230_2.png) [@chrisronline](https://discuss.elastic.co/u/chrisronline)\
**Post date:** [March 27, 2018, 7:21pm UTC](https://discuss.elastic.co/t/alias-on-bar-chart/125357/4 "2018-03-27T19:21:36Z")

</div>

@br14nb0

Yea, the scripted field will transform the field value, not the name.

You can use like a `.substring(` on the raw value and reduce it however you like. Or you can use [regexs](https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-examples.html#modules-scripting-painless-regex)

---

<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:** [April 24, 2018, 7:21pm UTC](https://discuss.elastic.co/t/alias-on-bar-chart/125357/5 "2018-04-24T19:21:59Z")

</div>

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