# Custom Label in Legend for Pie Chart

**URL:** <https://discuss.elastic.co/t/custom-label-in-legend-for-pie-chart/96970>\
**Category:** Kibana\
**Created:** [August 14, 2017, 1:36pm UTC](https://discuss.elastic.co/t/custom-label-in-legend-for-pie-chart/96970 "2017-08-14T13:36:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CDR](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CDR](https://discuss.elastic.co/u/CDR)\
**Post date:** [August 14, 2017, 1:36pm UTC](https://discuss.elastic.co/t/custom-label-in-legend-for-pie-chart/96970/1 "2017-08-14T13:36:26Z")

</div>

So I have a field called logMessage. It looks like this:

"Connection Terminated: book read from // **host** /stuff\_stuff:4294967295 failed (-268500976) (0) [file.c][2412]"

I want to make a pie chart with split slices on the the log messages. I want the label of each one to be the highlighted part of the message above

![image](https://us1.discourse-cdn.com/elastic/original/3X/9/b/9b136dd72cba00d35b567e6ebbfaa8fbdb61b01b.png)

As you can see in the picture all messages start with Connection Terminated. I know that you can make custom labels in the Timelion tool with regexs and was wondering if it was possible to do that with pie charts as well?

Thanks!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 14, 2017, 1:45pm UTC](https://discuss.elastic.co/t/custom-label-in-legend-for-pie-chart/96970/2 "2017-08-14T13:45:09Z")

</div>

Why not parse out host into a separate field at indexing time and use this for the visualisation?

---

<div class="post-metadata">

**Author:** ![CDR](https://avatars.discourse-cdn.com/v4/letter/c/d9b06d/32.png) [@CDR](https://discuss.elastic.co/u/CDR)\
**Post date:** [August 14, 2017, 1:52pm UTC](https://discuss.elastic.co/t/custom-label-in-legend-for-pie-chart/96970/3 "2017-08-14T13:52:38Z")

</div>

Long story short, it is not worth all the extra work for how much the log message appears/is used. It's not a deal breaker, otherwise I would implement it that way. I was wondering if there was an easy way to do this since the Timelion feature has it.

---

<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:** [September 11, 2017, 1:52pm UTC](https://discuss.elastic.co/t/custom-label-in-legend-for-pie-chart/96970/4 "2017-09-11T13:52:53Z")

</div>

Closed on September 11, 2017, 1:52pm UTC

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