monitor.stateChangesOnly() function
The monitor.stateChangesOnly()
function takes a stream of tables that contains a _level
column and returns a stream of tables where each record represents a state change.
Function type: Transformation
import "influxdata/influxdb/monitor"
monitor.stateChangesOnly()
Examples
Return records representing state changes
import "influxdata/influxdb/monitor"
monitor.from(start: -1h)
|> monitor.stateChangesOnly()
Given the following input:
_time | _level |
---|---|
0001 | ok |
0002 | ok |
0003 | warn |
0004 | crit |
monitor.stateChangesOnly()
outputs:
_time | _level |
---|---|
0002 | ok |
0003 | warn |
0004 | crit |
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, the following resources are available:
InfluxDB Cloud and InfluxDB Enterprise customers can contact InfluxData Support.