I have documents in an index that is timestamped. There is an index entry for each hour of the day, for each day of the month with multiple months in the index. Assume each hour document contains CPU MIPS values so the average would be AVG(MIPS).
I want to generate a SQL select statement that:
- calculates the AVG(MIPS) for each 24 hour in a day resulting in one value for each.
- for each day over a given start and end date.
Therefore there would be one return average value for each day over the selected date range i.e. 30 days for a given month. Therefore 30 return values , one for each day where each day represents the AVG over its corresponding 24 hour period.
What would the Elasticsearch SQL select statement be to generate this expected result?