# Timelion Visualization

**URL:** <https://discuss.elastic.co/t/timelion-visualization/177549>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [April 19, 2019, 1:05am UTC](https://discuss.elastic.co/t/timelion-visualization/177549 "2019-04-19T01:05:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shrutip](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@shrutip](https://discuss.elastic.co/u/shrutip)\
**Post date:** [April 19, 2019, 1:05am UTC](https://discuss.elastic.co/t/timelion-visualization/177549/1 "2019-04-19T01:05:41Z")

</div>

Hi,  
my requirement is to make a timelion .  
I need to count records group by two fields and with two where condition

Metric is count (where field1 = value1 and field2 = value2)  
group by - terms field1  
then by - date histogram @timestamp.

Thanks

---

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [April 19, 2019, 9:33pm UTC](https://discuss.elastic.co/t/timelion-visualization/177549/2 "2019-04-19T21:33:54Z")

</div>

Hi there!

I think the `.es()` function has all of what you need to do this. You should be able to do something similar to:

```auto
.es(q="+field1:'val1' +field2:'val2'", split=field3:10, timefield=@timestamp)

```

`q` is Lucene query syntax  
`split` will do a term aggregation on the specified field up to "10" top terms  
`timefiled` allows you to specify which column to use for the date histogram

Let me know if you need additional help!

---

<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 17, 2019, 9:33pm UTC](https://discuss.elastic.co/t/timelion-visualization/177549/3 "2019-05-17T21:33:58Z")

</div>

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