# Mysql to elasticsearch Query conversion

**URL:** <https://discuss.elastic.co/t/mysql-to-elasticsearch-query-conversion/29381>\
**Category:** Elasticsearch\
**Created:** [September 16, 2015, 10:57am UTC](https://discuss.elastic.co/t/mysql-to-elasticsearch-query-conversion/29381 "2015-09-16T10:57:58Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Croos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/croos/32/29489_2.png) [@Croos](https://discuss.elastic.co/u/Croos)\
**Post date:** [February 3, 2016, 7:37am UTC](https://discuss.elastic.co/t/mysql-to-elasticsearch-query-conversion/29381/9 "2016-02-03T07:37:04Z")

</div>

> [@Croos](#):
>
> Help me to convert this MySQL query to elasticsearch (json) query and how to set it on kibana.
> 
> SELECT user, call\_date, sum(call\_length\_in\_sec) as 'work\_time', (max(end\_epoch)-min(start\_epoch))-sum(length\_in\_sec) as 'idle\_time' FROM vicidial\_log WHERE date(call\_date)='2016-01-12' group by user

ok. Thanks for your response. I have posted the same as a new discussion. please refer it on the following link.

> [@Convert MySQL query to elasticsearch](https://discuss.elastic.co/t/convert-mysql-query-to-elasticsearch/40830):
>
> Help me to convert this MySQL query to elasticsearch (json) query and how to visualize it on kibana. SELECT user, call\_date, sum(length\_in\_sec) as 'work\_time', (max(end\_epoch)-min(start\_epoch))-sum(length\_in\_sec) as 'idle\_time' FROM vicidial\_log WHERE date(call\_date)='2016-01-12' group by user

---

_[View the full topic](https://discuss.elastic.co/t/mysql-to-elasticsearch-query-conversion/29381)._
