# Timelion dynamic lable by q=type

**URL:** <https://discuss.elastic.co/t/timelion-dynamic-lable-by-q-type/183608>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [May 30, 2019, 8:37pm UTC](https://discuss.elastic.co/t/timelion-dynamic-lable-by-q-type/183608 "2019-05-30T20:37:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ChristianSousa](https://avatars.discourse-cdn.com/v4/letter/c/c68b51/32.png) [@ChristianSousa](https://discuss.elastic.co/u/ChristianSousa)\
**Post date:** [May 30, 2019, 8:37pm UTC](https://discuss.elastic.co/t/timelion-dynamic-lable-by-q-type/183608/1 "2019-05-30T20:37:30Z")

</div>

Hey so I am trying to do a count over time with timelion based on a q= search, I cannot post screenshots but ill do my best show what I'm trying to do with fruits as an alias.

my search looks like:  
es.(kibana=true, q=Foods:Fruit, split=Fruit\_name:10).  
when I do this the data displays correctly but the labels in the legend show up as;  
q:Foods:Fruit\>Fruit\_name:"Apples"\>count  
q:Foods:Fruit\>Fruit\_name:"Oranges"\>count  
q:Foods:Fruit\>Fruit\_name:"Bananas"\>count

I would really love if there was a way to get labels to just be:  
Apples  
Oranges  
Bananas

is there a modifier for .label() that i don't know about or would I have to use some Regex ?

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [May 30, 2019, 10:33pm UTC](https://discuss.elastic.co/t/timelion-dynamic-lable-by-q-type/183608/2 "2019-05-30T22:33:27Z")

</div>

You should be able to do something like this

```auto
.es(kibana=true, q=Foods:Fruit, split=Fruit_name:10).label('$1', regex='.*>Fruit_name:"(.*)">.*')

```

---

<div class="post-metadata">

**Author:** ![ChristianSousa](https://avatars.discourse-cdn.com/v4/letter/c/c68b51/32.png) [@ChristianSousa](https://discuss.elastic.co/u/ChristianSousa)\
**Post date:** [May 31, 2019, 2:28pm UTC](https://discuss.elastic.co/t/timelion-dynamic-lable-by-q-type/183608/3 "2019-05-31T14:28:55Z")

</div>

Thanks, follow up question. the names I was trying to parse contained ":" and a space would this affect the functionality. For example if the line was:  
q:Foods:Fruit\>Fruit\_name:"Apples: Honeycrisp"\>count

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [May 31, 2019, 5:57pm UTC](https://discuss.elastic.co/t/timelion-dynamic-lable-by-q-type/183608/4 "2019-05-31T17:57:18Z")

</div>

I think the regex I provided should still work fine in that case.

---

<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:** [June 28, 2019, 6:08pm UTC](https://discuss.elastic.co/t/timelion-dynamic-lable-by-q-type/183608/5 "2019-06-28T18:08:11Z")

</div>

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