-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CLI examples for CloudWatch Logs #8995
base: develop
Are you sure you want to change the base?
Conversation
|
||
aws logs associate-kms-key \ | ||
--log-group-name demo-log-group \ | ||
--kms-key-id ``KMS_KEY_ID_ARN`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security software installed on my system blocks any push that contain sensitive info like KMS Key ID (even an example one). Hence, replaced it with KMS_KEY_ID_ARN.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Ashish,
Thank you for your command example submission. I've finished reviewing your pull request. Please fix these formatting issues and push your updated commit. Thanks!
|
||
aws logs associate-kms-key \ | ||
--log-group-name demo-log-group \ | ||
--kms-key-id ``KMS_KEY_ID_ARN`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--kms-key-id ``KMS_KEY_ID_ARN`` | |
--kms-key-id 1234abcd-12ab-34cd-56ef-1234567890ab |
@@ -0,0 +1,9 @@ | |||
**To Associate a KMS key with the log group** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**To Associate a KMS key with the log group** | |
**To associate a KMS key with the log group** |
@@ -0,0 +1,9 @@ | |||
**To Associate a KMS key with the log group** | |||
|
|||
The following ``associate-kms-key`` example associates KMS key with log group named ``demo-log-group``. If the command succeeds, no output is returned. :: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following ``associate-kms-key`` example associates KMS key with log group named ``demo-log-group``. If the command succeeds, no output is returned. :: | |
The following ``associate-kms-key`` example associates KMS key with log group named ``demo-log-group``. :: |
aws logs associate-kms-key \ | ||
--log-group-name demo-log-group \ | ||
--kms-key-id ``KMS_KEY_ID_ARN`` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command produces no output. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with the standard line after the example command as per the style guide:
https://aws.github.io/aws-cli/docs_styleguide.html#output
@@ -0,0 +1,8 @@ | |||
**To Cancel an export task** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**To Cancel an export task** | |
**To cancel an export task** |
@@ -0,0 +1,16 @@ | |||
**To Create or update a query definition for CloudWatch Logs Insights** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**To Create or update a query definition for CloudWatch Logs Insights** | |
**To create or update a query definition for CloudWatch Logs Insights** |
aws logs put-query-definition \ | ||
--name DemoLogsQueries/Example \ | ||
--log-group-names arn:aws:logs:us-east-1:123456789012:log-group:demo-log-group \ | ||
--query-string "stats sum(packets) as packetsTransferred by srcAddr, dstAddr | sort packetsTransferred desc | limit 100" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--query-string "stats sum(packets) as packetsTransferred by srcAddr, dstAddr | sort packetsTransferred desc | limit 100" | |
--query-string 'stats sum(packets) as packetsTransferred by srcAddr, dstAddr | sort packetsTransferred desc | limit 100' |
@@ -0,0 +1,16 @@ | |||
**To Create or update a query definition for CloudWatch Logs Insights** | |||
|
|||
The following ``put-query-definition`` example creates a query definition for CloudWatch Logs Insights. If the command succeeds, no output is returned. :: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following ``put-query-definition`` example creates a query definition for CloudWatch Logs Insights. If the command succeeds, no output is returned. :: | |
The following ``put-query-definition`` example creates a query definition for CloudWatch Logs Insights. :: |
@@ -0,0 +1,40 @@ | |||
**To Create or update a resource policy** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**To Create or update a resource policy** | |
**To create or update a resource policy** |
--policy-name AllowEventBridgeEventsToCWLogs \ | ||
--policy-document file://policy.json | ||
|
||
The file ``policy.json`` is a JSON document in the current folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file ``policy.json`` is a JSON document in the current folder. | |
Contents of ``policy.json``:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Ashish,
Thank you for your command example submission. I've finished reviewing your pull request. Please fix these formatting issues and push your updated commit. Thanks!
Issue #, if available:
Description of changes:
Add example CLI commands for Amazon CloudWatch Logs: https://docs.aws.amazon.com/cli/latest/reference/logs/
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.