Menu
AWS CloudTrail
API Reference (API Version 2013-11-01)

GetTrailStatus

Returns a JSON-formatted list of information about the specified trail. Fields include information on delivery errors, Amazon SNS and Amazon S3 errors, and start and stop logging times for each trail. This operation returns trail status from a single region. To return trail status from all regions, you must call the operation on each region.

Request Syntax

Copy
{ "Name": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Name

Specifies the name or the CloudTrail ARN of the trail for which you are requesting status. To get the status of a shadow trail (a replication of the trail in another region), you must specify its ARN. The format of a trail ARN is:

arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail

Type: String

Required: Yes

Response Syntax

Copy
{ "IsLogging": boolean, "LatestCloudWatchLogsDeliveryError": "string", "LatestCloudWatchLogsDeliveryTime": number, "LatestDeliveryAttemptSucceeded": "string", "LatestDeliveryAttemptTime": "string", "LatestDeliveryError": "string", "LatestDeliveryTime": number, "LatestDigestDeliveryError": "string", "LatestDigestDeliveryTime": number, "LatestNotificationAttemptSucceeded": "string", "LatestNotificationAttemptTime": "string", "LatestNotificationError": "string", "LatestNotificationTime": number, "StartLoggingTime": number, "StopLoggingTime": number, "TimeLoggingStarted": "string", "TimeLoggingStopped": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

IsLogging

Whether the CloudTrail is currently logging AWS API calls.

Type: Boolean

LatestCloudWatchLogsDeliveryError

Displays any CloudWatch Logs error that CloudTrail encountered when attempting to deliver logs to CloudWatch Logs.

Type: String

LatestCloudWatchLogsDeliveryTime

Displays the most recent date and time when CloudTrail delivered logs to CloudWatch Logs.

Type: Timestamp

LatestDeliveryAttemptSucceeded

This field is deprecated.

Type: String

LatestDeliveryAttemptTime

This field is deprecated.

Type: String

LatestDeliveryError

Displays any Amazon S3 error that CloudTrail encountered when attempting to deliver log files to the designated bucket. For more information see the topic Error Responses in the Amazon S3 API Reference.

Note

This error occurs only when there is a problem with the destination S3 bucket and will not occur for timeouts. To resolve the issue, create a new bucket and call UpdateTrail to specify the new bucket, or fix the existing objects so that CloudTrail can again write to the bucket.

Type: String

LatestDeliveryTime

Specifies the date and time that CloudTrail last delivered log files to an account's Amazon S3 bucket.

Type: Timestamp

LatestDigestDeliveryError

Displays any Amazon S3 error that CloudTrail encountered when attempting to deliver a digest file to the designated bucket. For more information see the topic Error Responses in the Amazon S3 API Reference.

Note

This error occurs only when there is a problem with the destination S3 bucket and will not occur for timeouts. To resolve the issue, create a new bucket and call UpdateTrail to specify the new bucket, or fix the existing objects so that CloudTrail can again write to the bucket.

Type: String

LatestDigestDeliveryTime

Specifies the date and time that CloudTrail last delivered a digest file to an account's Amazon S3 bucket.

Type: Timestamp

LatestNotificationAttemptSucceeded

This field is deprecated.

Type: String

LatestNotificationAttemptTime

This field is deprecated.

Type: String

LatestNotificationError

Displays any Amazon SNS error that CloudTrail encountered when attempting to send a notification. For more information about Amazon SNS errors, see the Amazon SNS Developer Guide.

Type: String

LatestNotificationTime

Specifies the date and time of the most recent Amazon SNS notification that CloudTrail has written a new log file to an account's Amazon S3 bucket.

Type: Timestamp

StartLoggingTime

Specifies the most recent date and time when CloudTrail started recording API calls for an AWS account.

Type: Timestamp

StopLoggingTime

Specifies the most recent date and time when CloudTrail stopped recording API calls for an AWS account.

Type: Timestamp

TimeLoggingStarted

This field is deprecated.

Type: String

TimeLoggingStopped

This field is deprecated.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

InvalidTrailNameException

This exception is thrown when the provided trail name is not valid. Trail names must meet the following requirements:

  • Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)

  • Start with a letter or number, and end with a letter or number

  • Be between 3 and 128 characters

  • Have no adjacent periods, underscores or dashes. Names like my-_namespace and my--namespace are invalid.

  • Not be in IP address format (for example, 192.168.5.4)

HTTP Status Code: 400

TrailNotFoundException

This exception is thrown when the trail with the given name is not found.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: