Documentation

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.

import "influxdata/influxdb/monitor"

monitor.stateChangesOnly()

Parameters

tables

Input data. Default is piped-forward data (<-).

Examples

Return records representing state changes
import "influxdata/influxdb/monitor"

monitor.from(start: -1h)
    |> monitor.stateChangesOnly()
Example input data
_time _level
0001 ok
0002 ok
0003 warn
0004 crit
Example output data
_time _level
0002 ok
0003 warn
0004 crit

Was this page helpful?

Thank you for your feedback!


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.