Run a simple sql group by query in kibana 4

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Run a simple sql group by query in kibana 4

PMOPMO
Hello all,
I want to run a simple sql group by query in kibana 4 "Discover" page.
Each record in my elastic search index represent a log and has 3 columns: process_id (not unique value), log_time, log_message.

example:

process_id        log_time                   log_message
----------------        --------------------           --------------------

1                   2014/12/11 01:00            msg1
1                   2014/12/11 01:10            msg2
1                   2014/12/11 01:20            msg3
2                   2014/12/11 11:00            msg4
2                   2014/12/11 11:10            msg5


I want to generate a table in kibana that looks like:


process_id        first log_time                 last log_time
----------------        ------------------------           --------------------
1                      2014/12/11 01:00           2014/12/11 01:20
2                      2014/12/11 11:00           2014/12/11 01:10


In sql the query is simple: 
select process_id, max(log_time), min(log_time)
from logs_table
group by process_id

How can I run this query in Kibana? Is it possible to run the query in "Discover" page or should I create a panel (Visualize page)?

thanks.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/7474c2a2-0a55-4a30-b0b2-a5271997288c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Run a simple sql group by query in kibana 4

PMOPMO
any ideas?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f991dd6e-9a37-4943-a055-39e2e1ed9621%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Run a simple sql group by query in kibana 4

PMOPMO
In reply to this post by PMOPMO
any update?

On Thursday, December 11, 2014 at 3:07:59 PM UTC+2, PMOPMO wrote:
Hello all,
I want to run a simple sql group by query in kibana 4 "Discover" page.
Each record in my elastic search index represent a log and has 3 columns: process_id (not unique value), log_time, log_message.

example:

process_id        log_time                   log_message
----------------        --------------------           --------------------

1                   2014/12/11 01:00            msg1
1                   2014/12/11 01:10            msg2
1                   2014/12/11 01:20            msg3
2                   2014/12/11 11:00            msg4
2                   2014/12/11 11:10            msg5


I want to generate a table in kibana that looks like:


process_id        first log_time                 last log_time
----------------        ------------------------           --------------------
1                      2014/12/11 01:00           2014/12/11 01:20
2                      2014/12/11 11:00           2014/12/11 01:10


In sql the query is simple: 
select process_id, max(log_time), min(log_time)
from logs_table
group by process_id

How can I run this query in Kibana? Is it possible to run the query in "Discover" page or should I create a panel (Visualize page)?

thanks.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/bf13be11-d003-4038-925a-37331d55f9ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Run a simple sql group by query in kibana 4

rodrilima
This post has NOT been accepted by the mailing list yet.
Hello,

I have the same problem. Any solution?
Reply | Threaded
Open this post in threaded view
|

Re: Run a simple sql group by query in kibana 4

hlstudio
This post has NOT been accepted by the mailing list yet.
in visualize, create a datatable visualize
1.select terms buckets on process_id. (this field not analyzed)
2.select two metrics,one is min on log_time,another is max on log_time.

the datatable is your answer.