Aggreation values with date time


(bagui) #1

Hi,

I'm using the below aggs for getting max, avg values from 2 data fields.
But the result is coming in unix timeformat I guess. Can I get the result
normal time format,

query==>
"aggs" : {
"max_time" : {
"max" : {
"script" : "doc['gi_xdr_info_end_time'].value -
doc['gi_xdr_info_start_time'].value"
}
},...
}

result ==>

  • "aggregations":{
    • "max_time":{
      • "value":60000.0
        },
    • "min_time":{
      • "value":0.0
        },
    • "avg_time":{
      • "value":46666.666666666664
        }
        }

mapping ==>

"call_start_time":{

  • "type":"date",
  • "format":"dateOptionalTime"

}

--
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/99d63453-b863-4954-9f0f-ec7ccfd522e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(bagui) #2

Hi,

Pls suggest...

--
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/5980b416-4b2d-4fae-9eb7-73e333d13fa9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Binh Ly-2) #3

Unfortunately, this is not supported at the moment. The value that you get
back is the milliseconds since epoch (1/1/1970) so that's how you can
convert it back yourself if needed.

--
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/dee9ce7d-78a2-4817-8232-c79ad34f8ea1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #4