Skip to content

Instantly share code, notes, and snippets.

@tarasowski
Last active December 19, 2023 12:33
Show Gist options
  • Save tarasowski/53ee2745a1c668b9a4cb333bc4c29641 to your computer and use it in GitHub Desktop.
Save tarasowski/53ee2745a1c668b9a4cb333bc4c29641 to your computer and use it in GitHub Desktop.
cloudwatchgrafana
fields @timestamp, @message
| parse @message '[ERROR]\t*\t*\t*' as errorTimestamp, errorId, errorMessage
| filter @message like '[ERROR]'
| display errorTimestamp, errorMessage
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowReadingMetricsFromCloudWatch",
"Effect": "Allow",
"Action": [
"cloudwatch:ListMetrics",
"cloudwatch:GetMetricStatistics",
"cloudwatch:GetMetricData",
"cloudwatch:*"
],
"Resource": "*"
},
{
"Sid": "AllowReadingMetricsFromCloudWatchLogs",
"Effect": "Allow",
"Action": [
"logs:DescribeLogGroups",
"logs:StartQuery",
"logs:*"
],
"Resource": "*"
},
{
"Sid": "AllowReadingTagsInstancesRegionsFromEC2",
"Effect": "Allow",
"Action": [
"ec2:DescribeTags",
"ec2:DescribeInstances",
"ec2:DescribeRegions"
],
"Resource": "*"
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:sts::586283906760:assumed-role/GrafanaCloudwatchRole-Custom/i-06decedae464c8117",
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment