count()
(data stream)
Was this page helpful?
Was this page helpful?
On this page
Sends a data stream to Splunk Observability Cloud.
Counts the number of MTS in the input stream that have data.
Syntax
Aggregation
count([by=grp])
Parameter definitions
Parameter | Type | Description |
---|---|---|
grp | string or array of strings. Default is None . | Name of a property or properties to group the output by. If you want to aggregate you need to specify by=grp. |
Transformation
count(over=duration)
Table 2. Parameter definitions
Parameter | Type | Description |
---|---|---|
duration | integer. Default is None . | Optional: Duration over which to count inputs. Durations are specified as a number followed by a single character: s: seconds m: minutes h: hours d: days |
Returns stream. If you want to transform, you need to specify over=duration
.
Examples
#Aggregation - count by env data('cpu.utilization').count(by='env') #Aggregation - count by env and datacenter data('cpu.utilization').count(by=['env', 'datacenter']) #Transformation - count cpu.utilization timeseries that have reported over 1 hour data('cpu.utilization').count(over='1h')