monitor.logs() 函数
monitor.logs()
检索存储在 _monitoring
存储桶的 notifications
measurement 中的通知事件。
函数类型签名
(
fn: (
r: {
A with
_value: B,
_time: time,
_stop: time,
_start: time,
_measurement: string,
_field: string,
},
) => bool,
start: C,
?stop: D,
) => stream[E] where E: Record
更多信息,请参阅 函数类型签名。
参数
start
(必需) 结果中包含的最早时间。
使用相对持续时间、绝对时间或整数(Unix 时间戳,单位为秒)。例如:-1h
、2019-08-28T22:00:00Z
或 1567029600
。持续时间相对于 now()
。
stop
结果中包含的最晚时间。默认为 now()
。
使用相对持续时间、绝对时间或整数(Unix 时间戳,单位为秒)。例如:-1h
、2019-08-28T22:00:00Z
或 1567029600
。持续时间相对于 now()
。
fn
(必需) 评估结果为 true 或 false 的谓词函数。
评估结果为 true
的记录或行 (r
) 将包含在输出表中。评估结果为 null 或 false
的记录将不包含在输出表中。
示例
查询过去一小时的通知事件
import "influxdata/influxdb/monitor"
monitor.logs(start: -2h, fn: (r) => true)
此页是否对您有帮助?
感谢您的反馈!