There are more AWS SDK examples available in the AWS Doc SDK Examples
Use StopLogging with a CLI
The following code examples show how to use StopLogging.
- CLI
-
- AWS CLI
-
To stop logging a trail
The following
stop-loggingcommand turns off logging forTrail1:aws cloudtrail stop-logging --nameTrail1-
For API details, see StopLogging
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: Suspends the recording of AWS API calls and log file delivery for the trail named 'myExampleTrail'. This example assumes the trail was created in the same region as the current shell default.
Stop-CTLogging -Name myExampleTrailExample 2: Suspends the recording of AWS API calls and log file delivery for a trail that was created in a region other than the current shell default (in this case, the Frankfurt (eu-central-1) region).
Stop-CTLogging -Name myExampleTrail -Region eu-central-1-
For API details, see StopLogging in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: Suspends the recording of AWS API calls and log file delivery for the trail named 'myExampleTrail'. This example assumes the trail was created in the same region as the current shell default.
Stop-CTLogging -Name myExampleTrailExample 2: Suspends the recording of AWS API calls and log file delivery for a trail that was created in a region other than the current shell default (in this case, the Frankfurt (eu-central-1) region).
Stop-CTLogging -Name myExampleTrail -Region eu-central-1-
For API details, see StopLogging in AWS Tools for PowerShell Cmdlet Reference (V5).
-