I am trying to create a visualization by considering a min of a start time and max of end time in a day logged by 1000's of documents based on a unique id. How can i perform this in Kibana ? Will scripted field help me here ?
for example
Total Hours: 2 hours is calculated from Doc1 and Doc2 with uniqueid : unique1
Doc 1
{
"runid" : "Unique1",
"starttime" : "2018-06-10 T 00:00:15"
"endtime" : "2018-06-10 T 00:48:15"
}
Doc2
{
"runid" : "Unique1",
"starttime" : "2018-06-10 T 00:50:15"
"endtime" : "2018-06-10 T 02:00:15"
}
Total Hours: 45mins is calculated from Doc3 and Doc4 with uniqueid : unique2
Doc 3
{
"runid" : "Unique2",
"starttime" : "2018-06-10 T 00:00:20"
"endtime" : "2018-06-10 T 00:26:15"
}
Doc4
{
"runid" : "Unique2",
"starttime" : "2018-06-10 T 00:27:15"
"endtime" : "2018-06-10 T 00:45:20"
}