Visualization based on time aggregation with the Date Fields

My JSON structure looks as follows with more than a million records with the same format with different starttime, endtime and setupnames.

"owner": "Robert",
"starttime": "2017-12-05T13:24:12.000Z",
"SetupName": "OA1125",
"endtime": "2017-12-05T18:24:12.000Z",
"owner": "Robert",
"starttime": "2017-12-05T18:24:12.000Z",
"SetupName": "OA1125",
"endtime": "2017-12-05T23:25:12.000Z",

I am trying to create a bar chart visualization with total hours spent against each SetupName by calculating the difference between EndTime - StartTime and aggregate over all records.

For Example from the above mentioned JSON the total hours of OA1125 is 10 hours ( 5 hours each from each json ), similar for other setupnames.

The bar chart visualization will be like

Yaxis - SetupName
Xaxis - Hours

OA1125 : ========== 10 hours
OA1126 : == 2 hours
OA1127 : ===== 5 hours

You're going to need to use a scripted field here, where the scripted field would calculate its value from starttime - endtime. Then, you can do a bar chart visualization, y-axis is sum of the scripted field, x-axis is a terms on SetupName.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.