I'm using Cloudwatch and Lambda to monitor logs. I have setup some filters that are triggered when a specific kind of error appears in the log. Is it possible to send on the Cloudwatch Alarm SNS the params that are filtered on the Log?
For example:
Receive Error :
[2017-06-29 17:58:52] prod.ERROR: ErrorException: Undefined variable: message X
Metric Filter :
[date,info="*.ERROR:",error]
Alarm :
IS OK when <= 0
Notification sent to SNS and Lambda to trigger different notification agents.
The SNS Event gives me this message , but I would like to access the filtered vars:
{
"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,