# \[Kibana Timelion\] how to create the timelion chart based on the values of a field dynamically

**URL:** <https://discuss.elastic.co/t/kibana-timelion-how-to-create-the-timelion-chart-based-on-the-values-of-a-field-dynamically/213857>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [January 6, 2020, 9:13am UTC](https://discuss.elastic.co/t/kibana-timelion-how-to-create-the-timelion-chart-based-on-the-values-of-a-field-dynamically/213857 "2020-01-06T09:13:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cheriemilk](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@cheriemilk](https://discuss.elastic.co/u/cheriemilk)\
**Post date:** [January 6, 2020, 9:13am UTC](https://discuss.elastic.co/t/kibana-timelion-how-to-create-the-timelion-chart-based-on-the-values-of-a-field-dynamically/213857/1 "2020-01-06T09:13:33Z")

</div>

Hi Team,

I need your help for timelion chart.

Suppose I have below events.

> @timestamp, module, page, action  
> t1, moduleA, pageA, moduleA.pageA.actionA  
> t2, moduleA, pageB, moduleA.pageB.actionB  
> t3, moduleA, pageC, moduleA.pageC.actionC  
> t4, moduleA, pageA, moduleA.pageA.actionA  
> t5, moduleA, pageB, moduleA.pageB.actionB  
> t6, moduleA, pageA, moduleA.pageA.actionA  
> ...  
> ...

And I want to create a timelion chart based on the action field to check how the number of usage for different actions changes as time goes by.  
But I didn't want to create the chart with below timelion expression as there're are many many actions in the real events and I am not able to list them one by one.

> .es(index=indexA,q="module:moduleA AND at:actionA").label("actionA" ).lines(fill=1,width=2).legend(columns=2, position=nw),  
> .es(index=indexA,q="module:moduleA AND at:actionB").label("actionA" ).lines(fill=1,width=2).legend(columns=2, position=nw),  
> .es(index=indexA,q="module:moduleA AND at:actionC").label("actionA" ).lines(fill=1,width=2).legend(columns=2, position=nw),  
> .es(...)  
> .title("Comparions - Key Actions")

Is there any convenient timelion expression to achieve this? For example, use regex like below (But It doesn't work as I am not familiar with regex)

> .es(index=indexA,q="module:moduleA AND at:_").label("moduleA.page[A|B] [$1]", "^._ \> type:(\S+) \> .\*")

Please help and advice!

Thanks,  
Cherie

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [January 6, 2020, 11:45pm UTC](https://discuss.elastic.co/t/kibana-timelion-how-to-create-the-timelion-chart-based-on-the-values-of-a-field-dynamically/213857/2 "2020-01-06T23:45:12Z")

</div>

I don't know of anything that does exactly what you're thinking with the regexes, but you might be able to do this using a `.split` function or using a Terms aggregation in TSVB.

---

<div class="post-metadata">

**Author:** ![cheriemilk](https://avatars.discourse-cdn.com/v4/letter/c/c37758/32.png) [@cheriemilk](https://discuss.elastic.co/u/cheriemilk)\
**Post date:** [January 7, 2020, 6:27am UTC](https://discuss.elastic.co/t/kibana-timelion-how-to-create-the-timelion-chart-based-on-the-values-of-a-field-dynamically/213857/3 "2020-01-07T06:27:28Z")

</div>

what is TSVB?

---

<div class="post-metadata">

**Author:** ![wylie](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wylie/32/81794_2.png) [@wylie](https://discuss.elastic.co/u/wylie)\
**Post date:** [January 7, 2020, 3:50pm UTC](https://discuss.elastic.co/t/kibana-timelion-how-to-create-the-timelion-chart-based-on-the-values-of-a-field-dynamically/213857/4 "2020-01-07T15:50:16Z")

</div>

TSVB is a visualization type in Kibana, it started as a graphical way to build Timelion visualizations but is more actively being developed against

---

<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:** [February 4, 2020, 3:50pm UTC](https://discuss.elastic.co/t/kibana-timelion-how-to-create-the-timelion-chart-based-on-the-values-of-a-field-dynamically/213857/5 "2020-02-04T15:50:17Z")

</div>

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