Create panel to display latency time using two datetime fields


(computer engineer) #1

I would like to display in a panel the lagtime between two times that come
in a message. I have no idea how to initiate it and would appreciate some
help:

inDate "2014-03-18 05:00:00" outDate: "2014-03-18 05:05:00"

lagtime = outdate - indate

So what I would expect is lagtime to show average lagtime coming in for all.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/90c09d4c-e138-48f1-b1c5-a8d6738255ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Binh Ly-2) #2

If you are referring to a Kibana panel, it sounds like you want something
like the histogram panel, except you want a script to get the value instead
of a field. The date histogram facet actually supports a value_script
computation, so you should be able to make a copy of Kibana histogram
panel, and slightly modify the call to the date histogram facet to pass in
your script into the value_script field.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/1c8f6a13-d603-403b-a8de-f5557b75b97b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(computer engineer) #3

Thanks for your response but I am completely confused here: I am actually
stuck on what the script would be. Technically I could put in a table
format as well but the actual query is what I am unsure about; the script?

On Tuesday, March 18, 2014 7:40:17 PM UTC-4, Binh Ly wrote:

If you are referring to a Kibana panel, it sounds like you want something
like the histogram panel, except you want a script to get the value instead
of a field. The date histogram facet actually supports a value_script
computation, so you should be able to make a copy of Kibana histogram
panel, and slightly modify the call to the date histogram facet to pass in
your script into the value_script field.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/d9e3dd38-6e7d-42ff-b323-076ab42f2550%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Binh Ly-2) #4

On this page:

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-date-histogram-facet.html#search-facets-date-histogram-facet

If you scroll down to the bottom, there is an example for value_script. In
your case, the value_script would be something like (the result is in
milliseconds, btw, so just convert accordingly if needed):

doc['outDate'].value - doc['inDate'].value

Again this is not supported by the Histogram Panel out of the box, but you
can implement it yourself using a new panel, or by hacking the Histogram
Panel.

--
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 elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/0ed2b6f2-e201-469f-88e1-7b147740c405%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #5