我正在使用Cloudwatch和Lambda监控日志。我已经设置了一些过滤器,当日志中出现特定类型的错误时触发这些过滤器。是否可能将在日志上过滤的参数发送到Cloudwatch Alarm SNS上?
例如:
接收错误:
[2017-06-29 17:58:52] prod.ERROR: ErrorException: Undefined variable: message X
度量过滤器:
[date,info="*.ERROR:",error]
警报:
当<=0时为IS OK
通知发送到SNS和Lambda以触发不同的通知代理。
SNS事件给了我这个消息,但我想访问过滤变量:
例如:
接收错误:
[2017-06-29 17:58:52] prod.ERROR: ErrorException: Undefined variable: message X
度量过滤器:
[date,info="*.ERROR:",error]
警报:
当<=0时为IS OK
通知发送到SNS和Lambda以触发不同的通知代理。
SNS事件给了我这个消息,但我想访问过滤变量:
{
"AlarmName": "PHP_ERROR",
"AlarmDescription": null,
"AWSAccountId": "xxxxxxxxx",
"NewStateValue": "OK",
"NewStateReason": "Threshold Crossed: no datapoints were received for 1 period and 1 missing datapoint was treated as [NonBreaching]",
"StateChangeTime": "2017-06-29T17:09:12.336+0000",
"Region": "EU - Ireland",
"OldStateValue": "ALARM",
"Trigger": {
"MetricName": "PHP_ERROR",
"Namespace": "Logs",
"StatisticType": "Statistic",
"Statistic": "SUM",
"Unit": null,
"Dimensions": [],
"Period": 60,
"EvaluationPeriods": 1,
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Threshold": 0,
"TreatMissingData": "- TreatMissingData: NonBreaching",
"EvaluateLowSampleCountPercentile": ""
}
}
Thanks,