I am counting documents in Elasticsearch 7. Each document represents a single HTTP response from a web server.
The panel interval is 5 seconds, so each tick on my timeseries panel represents the number of HTTP responses that were ingested within that 5 second period. I want to show this number as a rate. For example: responses per minute (multiply by 12), or responses per second (divide by 5).
Is this a thing that you can do with a Count? How can I achieve this?
In metric section you have a script input text where you can deal with it.
That is true for calculations such as Max and Sum against collected metrics, but it is not true for Count.
Perhaps if I could get an Avg or Sum of the Count, I could use the script field? I don’t know how to achieve that because Count isn’t related to a metric we are collecting. It is the number of documents returned by the query.
It’s true. Count doesn’t support scripted fields. I’m not prety sure but, have you tried with bucket script metric?
I’m not sure what that means, but I am interested in trying.
I have resolved to using a fixed custom time window with this panel, so that the Count figure that is shown at least has some meaning.