-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CloudWatch Log Insights query snippets for EventBridge events.
- Loading branch information
1 parent
e5918e2
commit 5825a7f
Showing
28 changed files
with
527 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
cloudwatch-insight-eventbridge-event-by-detail-type-like/sample-data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"title": "Events that match a pattern for detail-type value", | ||
"description": "Get the EventBridge events that match a pattern for detail-type value", | ||
"type": "CloudWatch Logs Insights", | ||
"services": [], | ||
"tags": [ | ||
"" | ||
], | ||
"introBox": { | ||
"headline": "How it works", | ||
"text": ["Cloudwatch Log Insight snippet that gets the EventBridge events that matches a pattern for detail-type value"] | ||
}, | ||
"gitHub": { | ||
"template": { | ||
"repoURL": "https://github.com/aws-samples/serverless-snippets/tree/main/cloudwatch-insight-eventbridge-event-by-detail-type-like" | ||
} | ||
}, | ||
"snippets": [ | ||
{ | ||
"snippetPath": "snippet.txt", | ||
"language": "css" | ||
} | ||
], | ||
"authors": [ | ||
{ | ||
"headline": "Presented by Rahul Sringeri", | ||
"name": "Rahul Sringeri", | ||
"image": "", | ||
"bio": "Technical Account Manager at AWS for Strategic Accounts", | ||
"linkedin": "", | ||
"twitter": "" | ||
} | ||
] | ||
} | ||
|
3 changes: 3 additions & 0 deletions
3
cloudwatch-insight-eventbridge-event-by-detail-type-like/snippet.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fields @timestamp | ||
| filter `detail-type` like /sample-value/ # replace sample-value with actual value to be searched | ||
| sort @timestamp desc |
35 changes: 35 additions & 0 deletions
35
cloudwatch-insight-eventbridge-event-count-by-source/snippet-data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"title": "Events grouped by source", | ||
"description": "Get the number of EventBridge events by source", | ||
"type": "CloudWatch Logs Insights", | ||
"services": [], | ||
"tags": [ | ||
"" | ||
], | ||
"introBox": { | ||
"headline": "How it works", | ||
"text": ["Cloudwatch Log Insight snippet that counts the number of EventBridge events and groups by source"] | ||
}, | ||
"gitHub": { | ||
"template": { | ||
"repoURL": "https://github.com/aws-samples/serverless-snippets/tree/main/cloudwatch-insight-eventbridge-event-count-by-source" | ||
} | ||
}, | ||
"snippets": [ | ||
{ | ||
"snippetPath": "snippet.txt", | ||
"language": "css" | ||
} | ||
], | ||
"authors": [ | ||
{ | ||
"headline": "Presented by Rahul Sringeri", | ||
"name": "Rahul Sringeri", | ||
"image": "", | ||
"bio": "Technical Account Manager at AWS for Strategic Accounts", | ||
"linkedin": "", | ||
"twitter": "" | ||
} | ||
] | ||
} | ||
|
3 changes: 3 additions & 0 deletions
3
cloudwatch-insight-eventbridge-event-count-by-source/snippet.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fields @timestamp | ||
| stats count(*) as EventsCountBySource by source | ||
| sort @timestamp desc |
34 changes: 34 additions & 0 deletions
34
cloudwatch-insight-eventbridge-event-detail-field-within-a-numeric-range/sample-data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"title": "Events with detail field value falling in a given numeric range ", | ||
"description": "Get the EventBridge events for a given detail field that has values within a given numeric range", | ||
"type": "CloudWatch Logs Insights", | ||
"services": [], | ||
"tags": [ | ||
"" | ||
], | ||
"introBox": { | ||
"headline": "How it works", | ||
"text": ["Cloudwatch Log Insight snippet that returns the EventBridge events for a given detail field that has values within a given numeric range"] | ||
}, | ||
"gitHub": { | ||
"template": { | ||
"repoURL": "https://github.com/aws-samples/serverless-snippets/tree/main/cloudwatch-insight-eventbridge-event-detail-field-within-a-numeric-range" | ||
} | ||
}, | ||
"snippets": [ | ||
{ | ||
"snippetPath": "snippet.txt", | ||
"language": "css" | ||
} | ||
], | ||
"authors": [ | ||
{ | ||
"headline": "Presented by Rahul Sringeri", | ||
"name": "Rahul Sringeri", | ||
"image": "", | ||
"bio": "Technical Account Manager at AWS for Strategic Accounts", | ||
"linkedin": "", | ||
"twitter": "" | ||
} | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
cloudwatch-insight-eventbridge-event-detail-field-within-a-numeric-range/snippet.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fields @timestamp | ||
| filter detail.field-value >= N1 and detail.field-value <= N2 # replace field-value, N1, N2 with actual values. N1 and N2 are the numeric range. | ||
| sort @timestamp desc |
35 changes: 35 additions & 0 deletions
35
cloudwatch-insight-eventbridge-event-filter-by-detail-field-equal-to/sample-data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"title": "Filter Events by value of a detail field", | ||
"description": "Get the EventBridge events by filtering on a detail field", | ||
"type": "CloudWatch Logs Insights", | ||
"services": [], | ||
"tags": [ | ||
"" | ||
], | ||
"introBox": { | ||
"headline": "How it works", | ||
"text": ["Cloudwatch Log Insight snippet that filters the EventBridge events by value of a detail field"] | ||
}, | ||
"gitHub": { | ||
"template": { | ||
"repoURL": "https://github.com/aws-samples/serverless-snippets/tree/main/cloudwatch-insight-eventbridge-event-filter-by-detail-field" | ||
} | ||
}, | ||
"snippets": [ | ||
{ | ||
"snippetPath": "snippet.txt", | ||
"language": "css" | ||
} | ||
], | ||
"authors": [ | ||
{ | ||
"headline": "Presented by Rahul Sringeri", | ||
"name": "Rahul Sringeri", | ||
"image": "", | ||
"bio": "Technical Account Manager at AWS for Strategic Accounts", | ||
"linkedin": "", | ||
"twitter": "" | ||
} | ||
] | ||
} | ||
|
3 changes: 3 additions & 0 deletions
3
cloudwatch-insight-eventbridge-event-filter-by-detail-field-equal-to/snippet.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fields @timestamp | ||
| filter detail.field-name = "field-value" # replace field-name and field-value with actual values | ||
| sort @timestamp desc |
34 changes: 34 additions & 0 deletions
34
cloudwatch-insight-eventbridge-event-filter-by-detail-field-not-equal-to/sample-data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"title": "Filter Events by detail field value not equal to a given value", | ||
"description": "Get the EventBridge events by filtering on a detail field value that is not equal to a given value ", | ||
"type": "CloudWatch Logs Insights", | ||
"services": [], | ||
"tags": [ | ||
"" | ||
], | ||
"introBox": { | ||
"headline": "How it works", | ||
"text": ["Cloudwatch Log Insight snippet that filters the EventBridge events on a detail field value not equal to a given value"] | ||
}, | ||
"gitHub": { | ||
"template": { | ||
"repoURL": "https://github.com/aws-samples/serverless-snippets/tree/main/cloudwatch-insight-eventbridge-event-filter-by-detail-field-not-equal-to" | ||
} | ||
}, | ||
"snippets": [ | ||
{ | ||
"snippetPath": "snippet.txt", | ||
"language": "css" | ||
} | ||
], | ||
"authors": [ | ||
{ | ||
"headline": "Presented by Rahul Sringeri", | ||
"name": "Rahul Sringeri", | ||
"image": "", | ||
"bio": "Technical Account Manager at AWS for Strategic Accounts", | ||
"linkedin": "", | ||
"twitter": "" | ||
} | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
cloudwatch-insight-eventbridge-event-filter-by-detail-field-not-equal-to/snippet.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fields @timestamp | ||
| filter detail.field-name != "field-value" # replace field-name and field-value with actual values | ||
| sort @timestamp desc |
35 changes: 35 additions & 0 deletions
35
cloudwatch-insight-eventbridge-event-filter-by-detail-type-equal-to/sample-data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"title": "Events that match the value of detail-type", | ||
"description": "Get the EventBridge events that match the value of detail-type", | ||
"type": "CloudWatch Logs Insights", | ||
"services": [], | ||
"tags": [ | ||
"" | ||
], | ||
"introBox": { | ||
"headline": "How it works", | ||
"text": ["Cloudwatch Log Insight snippet that filters the EventBridge events by value of detail-type"] | ||
}, | ||
"gitHub": { | ||
"template": { | ||
"repoURL": "https://github.com/aws-samples/serverless-snippets/tree/main/cloudwatch-insight-eventbridge-event-filter-by-detail-type" | ||
} | ||
}, | ||
"snippets": [ | ||
{ | ||
"snippetPath": "snippet.txt", | ||
"language": "css" | ||
} | ||
], | ||
"authors": [ | ||
{ | ||
"headline": "Presented by Rahul Sringeri", | ||
"name": "Rahul Sringeri", | ||
"image": "", | ||
"bio": "Technical Account Manager at AWS for Strategic Accounts", | ||
"linkedin": "", | ||
"twitter": "" | ||
} | ||
] | ||
} | ||
|
3 changes: 3 additions & 0 deletions
3
cloudwatch-insight-eventbridge-event-filter-by-detail-type-equal-to/snippet.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fields @timestamp | ||
| filter `detail-type` = "detail-type-value" # replace detail-type-value with the actual value | ||
| sort @timestamp desc |
35 changes: 35 additions & 0 deletions
35
...watch-insight-eventbridge-event-filter-detail-field-with-values-in-array/sample-data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"title": "Events that match a value in detail-field that has an array of values", | ||
"description": "Get the EventBridge events that match a value in detail-field that has an array of values", | ||
"type": "CloudWatch Logs Insights", | ||
"services": [], | ||
"tags": [ | ||
"" | ||
], | ||
"introBox": { | ||
"headline": "How it works", | ||
"text": ["Cloudwatch Log Insight snippet that gets the EventBridge events that matches a value in detail-field that has an array of values"] | ||
}, | ||
"gitHub": { | ||
"template": { | ||
"repoURL": "https://github.com/aws-samples/serverless-snippets/tree/main/cloudwatch-insight-eventbridge-event-filter-detail-field-with-values-in-array" | ||
} | ||
}, | ||
"snippets": [ | ||
{ | ||
"snippetPath": "snippet.txt", | ||
"language": "css" | ||
} | ||
], | ||
"authors": [ | ||
{ | ||
"headline": "Presented by Rahul Sringeri", | ||
"name": "Rahul Sringeri", | ||
"image": "", | ||
"bio": "Technical Account Manager at AWS for Strategic Accounts", | ||
"linkedin": "", | ||
"twitter": "" | ||
} | ||
] | ||
} | ||
|
3 changes: 3 additions & 0 deletions
3
cloudwatch-insight-eventbridge-event-filter-detail-field-with-values-in-array/snippet.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fields @timestamp | ||
| filter detail.array-field.n1 = "sample-value" # replace array-field with the field name having values as array, n1 with array position and sample-value with value to filter. | ||
| sort @timestamp desc |
35 changes: 35 additions & 0 deletions
35
cloudwatch-insight-eventbridge-event-find-if-detail-field-exists/sample-data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"title": "Get Events if a given detail field is present ", | ||
"description": "Get the EventBridge events if detail field is present", | ||
"type": "CloudWatch Logs Insights", | ||
"services": [], | ||
"tags": [ | ||
"" | ||
], | ||
"introBox": { | ||
"headline": "How it works", | ||
"text": ["Cloudwatch Log Insight snippet that returns the EventBridge events if a given detail field is present"] | ||
}, | ||
"gitHub": { | ||
"template": { | ||
"repoURL": "https://github.com/aws-samples/serverless-snippets/tree/main/cloudwatch-insight-eventbridge-event-find-if-detail-field-exists" | ||
} | ||
}, | ||
"snippets": [ | ||
{ | ||
"snippetPath": "snippet.txt", | ||
"language": "css" | ||
} | ||
], | ||
"authors": [ | ||
{ | ||
"headline": "Presented by Rahul Sringeri", | ||
"name": "Rahul Sringeri", | ||
"image": "", | ||
"bio": "Technical Account Manager at AWS for Strategic Accounts", | ||
"linkedin": "", | ||
"twitter": "" | ||
} | ||
] | ||
} | ||
|
3 changes: 3 additions & 0 deletions
3
cloudwatch-insight-eventbridge-event-find-if-detail-field-exists/snippet.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fields @timestamp | ||
| filter ispresent(detail.field-name) # replace field-name with the actual value | ||
| sort @timestamp desc |
34 changes: 34 additions & 0 deletions
34
cloudwatch-insight-eventbridge-event-per-hour/sample-data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"title": "Events per hour ", | ||
"description": "Get the EventBridge events per hour", | ||
"type": "CloudWatch Logs Insights", | ||
"services": [], | ||
"tags": [ | ||
"" | ||
], | ||
"introBox": { | ||
"headline": "How it works", | ||
"text": ["Cloudwatch Log Insight snippet that returns the EventBridge events per hour"] | ||
}, | ||
"gitHub": { | ||
"template": { | ||
"repoURL": "https://github.com/aws-samples/serverless-snippets/tree/main/cloudwatch-insight-eventbridge-event-per-minute" | ||
} | ||
}, | ||
"snippets": [ | ||
{ | ||
"snippetPath": "snippet.txt", | ||
"language": "css" | ||
} | ||
], | ||
"authors": [ | ||
{ | ||
"headline": "Presented by Rahul Sringeri", | ||
"name": "Rahul Sringeri", | ||
"image": "", | ||
"bio": "Technical Account Manager at AWS for Strategic Accounts", | ||
"linkedin": "", | ||
"twitter": "" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
fields @timestamp | ||
| filter ispresent(`detail-type`) | ||
| stats count(*) as CountOfEventsPerHour by bin(1h) | ||
| sort @timestamp desc |
Oops, something went wrong.