# Label value formatter inside a Visual to show unescaped text

**URL:** <https://discuss.elastic.co/t/label-value-formatter-inside-a-visual-to-show-unescaped-text/47899>\
**Category:** Kibana\
**Created:** [April 20, 2016, 10:55am UTC](https://discuss.elastic.co/t/label-value-formatter-inside-a-visual-to-show-unescaped-text/47899 "2016-04-20T10:55:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_Colton](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@Jeremy\_Colton](https://discuss.elastic.co/u/Jeremy_Colton)\
**Post date:** [April 20, 2016, 10:55am UTC](https://discuss.elastic.co/t/label-value-formatter-inside-a-visual-to-show-unescaped-text/47899/1 "2016-04-20T10:55:21Z")

</div>

Hi,  
My Elastic Search index has a String field "event" which has many escaped values Eg  
App%20Loaded  
Button%20Clicked

When I build visuals (line graphs, pie charts etc.) using this field, the values shown are also escaped (Eg "App%20Loaded"). The end-user is not technical and doesn't understand what this is. How can I get Kibana to display the unescaped text eg "App Loaded"?

I read about field formatters [https://www.elastic.co/blog/kibana-4-1-field-formatters](https://www.elastic.co/blog/kibana-4-1-field-formatters) but I think this is ONLY for displaying fields in the Discovery tab of Kibana, not inside visuals.

Many thanks.

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [April 20, 2016, 10:43pm UTC](https://discuss.elastic.co/t/label-value-formatter-inside-a-visual-to-show-unescaped-text/47899/2 "2016-04-20T22:43:53Z")

</div>

Field formatters are definitely the way to solve this, and adding one would in fact affect the labels on visualizations.

Unfortunately, there's not a string replacement or url encode/decode formatter at the moment. If you're a developer, you could write your own, and even install it as a plugin though, it's pretty easy to figure out how by looking at the existing filters.

The other alternative is to use the custom label functionality introduced recently, assuming you're Kibana version is up to date.

---

<div class="post-metadata">

**Author:** ![Jeremy\_Colton](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@Jeremy\_Colton](https://discuss.elastic.co/u/Jeremy_Colton)\
**Post date:** [April 23, 2016, 1:32pm UTC](https://discuss.elastic.co/t/label-value-formatter-inside-a-visual-to-show-unescaped-text/47899/3 "2016-04-23T13:32:53Z")

</div>

Hi Joe,

The values of each label are dynamic. So I can't use the 'custom label functonality' unless it allows dynamic values and also has a string decoder. Does it?

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [April 25, 2016, 4:28pm UTC](https://discuss.elastic.co/t/label-value-formatter-inside-a-visual-to-show-unescaped-text/47899/4 "2016-04-25T16:28:52Z")

</div>

It does not, custom labels are simple static values you'd like to display instead of the field name.

Writing a custom field formatter sounds like your best bet. There's also a [related regex filter request](https://github.com/elastic/kibana/issues/6276) on our repo, feel free to drop a comment or +1 over there as well. If you end up writing something, we'd love to hear about it, or even better, work with you to get it into Kibana.

---

<div class="post-metadata">

**Author:** ![Jeremy\_Colton](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@Jeremy\_Colton](https://discuss.elastic.co/u/Jeremy_Colton)\
**Post date:** [April 26, 2016, 9:57am UTC](https://discuss.elastic.co/t/label-value-formatter-inside-a-visual-to-show-unescaped-text/47899/5 "2016-04-26T09:57:26Z")

</div>

Hi, I'm gonna look at writing a custom filter for this. Please can you provide a link to an existing filter and how it's integrated? If I get it working, I'll let you know so it can perhaps be integrated.

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [April 26, 2016, 4:47pm UTC](https://discuss.elastic.co/t/label-value-formatter-inside-a-visual-to-show-unescaped-text/47899/6 "2016-04-26T16:47:41Z")

</div>

Kibana is actually written in large part as a collection of different plugins, and you can see a bunch of examples by [looking at the source](https://github.com/elastic/kibana/tree/master/src/plugins). It uses various registers as a way to extend components. You can see this in the way that we provide the default field formatters [by looking at this registry file](https://github.com/elastic/kibana/blob/master/src/ui/public/stringify/register.js).

So basically, in your plugin, you `import fieldFormats from 'ui/registry/field_formats';` and then `fieldFormats.register` your custom formatter.

As for writing your plugin as an actual plugin, we have a [yeoman generator](https://github.com/elastic/generator-kibana-plugin) to help you get started. Unfortunately we don't yet have concrete documentation around building a plugin, but if the source isn't good enough, [this user wrote up an excellent blog post](https://www.timroes.de/2016/02/17/writing-kibana-4-plugins-field-formatters/) for creating a custom field formatter, as well as many other types of Kibana plugins. There's also [this video](https://www.elastic.co/elasticon/conf/2016/sf/how-to-build-your-own-kibana-plugins) from Elasticon '16 that you might find helpful.

And of course, if you have questions along the way, feel free to post here, or if you need faster answers, come bug us in IRC; we're in #kibana on freenode.

---

<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:55pm UTC](https://discuss.elastic.co/t/label-value-formatter-inside-a-visual-to-show-unescaped-text/47899/7 "2017-07-06T13:55:01Z")

</div>


