

Doc AWS SDK 예제 GitHub 리포지토리에서 더 많은 SDK 예제를 사용할 수 있습니다. [AWS](https://github.com/awsdocs/aws-doc-sdk-examples) 

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# CLI로 `GetTrailStatus` 사용
<a name="cloudtrail_example_cloudtrail_GetTrailStatus_section"></a>

다음 코드 예시는 `GetTrailStatus`의 사용 방법을 보여 줍니다.

------
#### [ CLI ]

**AWS CLI**  
**추적 상태를 가져오는 방법**  
다음 `get-trail-status` 명령은 `Trail1`에 대한 전송 및 로깅 세부 정보를 반환합니다.  

```
aws cloudtrail get-trail-status --name Trail1
```
출력:  

```
{
  "LatestNotificationTime": 1454022144.869,
  "LatestNotificationAttemptSucceeded": "2016-01-28T23:02:24Z",
  "LatestDeliveryAttemptTime": "2016-01-28T23:02:24Z",
  "LatestDeliveryTime": 1454022144.869,
  "TimeLoggingStarted": "2015-11-06T18:36:38Z",
  "LatestDeliveryAttemptSucceeded": "2016-01-28T23:02:24Z",
  "IsLogging": true,
  "LatestCloudWatchLogsDeliveryTime": 1454022144.918,
  "StartLoggingTime": 1446834998.695,
  "StopLoggingTime": 1446834996.933,
  "LatestNotificationAttemptTime": "2016-01-28T23:02:24Z",
  "TimeLoggingStopped": "2015-11-06T18:36:36Z"
}
```
+  API 세부 정보는 **AWS CLI 명령 참조의 [GetTrailStatus](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudtrail/get-trail-status.html)를 참조하세요.

------
#### [ PowerShell ]

**Tools for PowerShell V4**  
**예제 1: 이름이 'myExampleTrail'인 추적의 상태 정보를 반환합니다. 반환된 데이터에는 전송 오류, Amazon SNS 및 Amazon S3 오류, 추적의 로깅 시작 및 중지 시간에 대한 정보가 포함됩니다. 이 예제에서는 추적이 현재 쉘 기본값과 동일한 리전에서 생성되었다고 가정합니다.**  

```
Get-CTTrailStatus -Name myExampleTrail
```
**예제 2: 현재 쉘 기본값이 아닌 리전(이 경우 프랑크푸르트(eu-central-1) 리전)에서 생성된 추적의 상태 정보를 반환합니다.**  

```
Get-CTTrailStatus -Name myExampleTrail -Region eu-central-1
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V4)*의 [GetTrailStatus](https://docs.aws.amazon.com/powershell/v4/reference)를 참조하세요.

**Tools for PowerShell V5**  
**예제 1: 이름이 'myExampleTrail'인 추적의 상태 정보를 반환합니다. 반환된 데이터에는 전송 오류, Amazon SNS 및 Amazon S3 오류, 추적의 로깅 시작 및 중지 시간에 대한 정보가 포함됩니다. 이 예제에서는 추적이 현재 쉘 기본값과 동일한 리전에서 생성되었다고 가정합니다.**  

```
Get-CTTrailStatus -Name myExampleTrail
```
**예제 2: 현재 쉘 기본값이 아닌 리전(이 경우 프랑크푸르트(eu-central-1) 리전)에서 생성된 추적의 상태 정보를 반환합니다.**  

```
Get-CTTrailStatus -Name myExampleTrail -Region eu-central-1
```
+  API 세부 정보는 *AWS Tools for PowerShell Cmdlet 참조(V5)*의 [GetTrailStatus](https://docs.aws.amazon.com/powershell/v5/reference)를 참조하세요.

------