countby - Count grouped values
The countby
operator will generate a count for each row in a group.
NOTE: This differs from count
, which will count the entire resultset, and will instead count based on a grouping key.
Syntax
NOTE: An alias can be provided to override the keypath the result will be written into.
Example - Count the number of requests by HTTP Status Code
A simple calculation to perform on HTTP request logs is to count by HTTP status code.
We can also name our count column using the into
keyword:
Theme
Light