# Is it possible to shorten / give an alias to Timelion query?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-shorten-give-an-alias-to-timelion-query/81939>\
**Category:** Kibana\
**Created:** [April 11, 2017, 8:24am UTC](https://discuss.elastic.co/t/is-it-possible-to-shorten-give-an-alias-to-timelion-query/81939 "2017-04-11T08:24:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)\
**Post date:** [April 11, 2017, 8:24am UTC](https://discuss.elastic.co/t/is-it-possible-to-shorten-give-an-alias-to-timelion-query/81939/1 "2017-04-11T08:24:33Z")

</div>

Hi,

i am using ELK GA 5.0.0. In my Timelion, I have a query like below;

```
.es(index=mylogsA-*, timefield=time, q='action:ActionA|ActionB|ActionC|ActionD|ActionE|ActionF|ActionG|ActionH|ActionI|ActionJ|ActionK|ActionL|ActionM|ActionN|Action)|ActionP|ActionQ|ActionR',metric=count).divide(.es(index=mylogsA-*, timefield=time, q='action:ActionY|ActionZ',metric=count)).color(#F00).points(radius=3, weight=1)

```

This creates a long query display in the chart, and scroll bar appear below. On hovering the chart, the count get displayed along with q, which is not always convenient to see. Is there any way to give an alias, or similar mechanism, so that in my chart, it will be like `q=myquery`?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [April 11, 2017, 9:54am UTC](https://discuss.elastic.co/t/is-it-possible-to-shorten-give-an-alias-to-timelion-query/81939/2 "2017-04-11T09:54:55Z")

</div>

Hi @elasticcloud,

while there is currently no way to alias the query in the query bar, you can use the `.label()` function of your series to influence the name of the query in the legend, e.g. `.label("myquery")`. It even supports regex capture groups for dynamic labels.

---

<div class="post-metadata">

**Author:** ![elasticheart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticheart/32/65189_2.png) [@elasticheart](https://discuss.elastic.co/u/elasticheart)\
**Post date:** [April 11, 2017, 9:59am UTC](https://discuss.elastic.co/t/is-it-possible-to-shorten-give-an-alias-to-timelion-query/81939/3 "2017-04-11T09:59:26Z")

</div>

@weltenwort this is exactly what I was looking for. Thanks 🙂

---

<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:** [May 9, 2017, 10:05am UTC](https://discuss.elastic.co/t/is-it-possible-to-shorten-give-an-alias-to-timelion-query/81939/4 "2017-05-09T10:05:57Z")

</div>

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