I'm trying to do a SUM on a query, and can't seem to get anything to work. Perhaps I'm using the wrong syntax, but I keep getting the error message "Cannot use non-grouped column".
I'm using metricbeat to collect metrics on some systems. The fields I'm interested in are "host.name" and "system.diskio.iostat.read.request.per_sec". I want to sum each host's system.diskio.iostat.read.request.per_sec value to give me a total IOPS across all hosts. The query I'm trying to run is as follows:
"SELECT host.name as hostname, SUM(system.diskio.iostat.read.request.per_sec) as IOPS, "@timestamp" as time FROM "metricbeat-*""
I'm not sure if my syntax is wrong, or if I need to do some grouping by time stamp, or what.