CloudTrail / Client / put_insight_selectors

put_insight_selectors#

CloudTrail.Client.put_insight_selectors(**kwargs)#

Lets you enable Insights event logging by specifying the Insights selectors that you want to enable on an existing trail. You also use PutInsightSelectors to turn off Insights event logging, by passing an empty list of insight types. The valid Insights event types in this release are ApiErrorRateInsight and ApiCallRateInsight.

To log CloudTrail Insights events on API call volume, the trail must log write management events. To log CloudTrail Insights events on API error rate, the trail must log read or write management events. You can call GetEventSelectors on a trail to check whether the trail logs management events.

See also: AWS API Documentation

Request Syntax

response = client.put_insight_selectors(
    TrailName='string',
    InsightSelectors=[
        {
            'InsightType': 'ApiCallRateInsight'|'ApiErrorRateInsight'
        },
    ]
)
Parameters:
  • TrailName (string) –

    [REQUIRED]

    The name of the CloudTrail trail for which you want to change or add Insights selectors.

  • InsightSelectors (list) –

    [REQUIRED]

    A JSON string that contains the insight types you want to log on a trail. ApiCallRateInsight and ApiErrorRateInsight are valid Insight types.

    The ApiCallRateInsight Insights type analyzes write-only management API calls that are aggregated per minute against a baseline API call volume.

    The ApiErrorRateInsight Insights type analyzes management API calls that result in error codes. The error is shown if the API call is unsuccessful.

    • (dict) –

      A JSON string that contains a list of Insights types that are logged on a trail.

      • InsightType (string) –

        The type of Insights events to log on a trail. ApiCallRateInsight and ApiErrorRateInsight are valid Insight types.

        The ApiCallRateInsight Insights type analyzes write-only management API calls that are aggregated per minute against a baseline API call volume.

        The ApiErrorRateInsight Insights type analyzes management API calls that result in error codes. The error is shown if the API call is unsuccessful.

Return type:

dict

Returns:

Response Syntax

{
    'TrailARN': 'string',
    'InsightSelectors': [
        {
            'InsightType': 'ApiCallRateInsight'|'ApiErrorRateInsight'
        },
    ]
}

Response Structure

  • (dict) –

    • TrailARN (string) –

      The Amazon Resource Name (ARN) of a trail for which you want to change or add Insights selectors.

    • InsightSelectors (list) –

      A JSON string that contains the Insights event types that you want to log on a trail. The valid Insights types in this release are ApiErrorRateInsight and ApiCallRateInsight.

      • (dict) –

        A JSON string that contains a list of Insights types that are logged on a trail.

        • InsightType (string) –

          The type of Insights events to log on a trail. ApiCallRateInsight and ApiErrorRateInsight are valid Insight types.

          The ApiCallRateInsight Insights type analyzes write-only management API calls that are aggregated per minute against a baseline API call volume.

          The ApiErrorRateInsight Insights type analyzes management API calls that result in error codes. The error is shown if the API call is unsuccessful.

Exceptions

  • CloudTrail.Client.exceptions.TrailNotFoundException

  • CloudTrail.Client.exceptions.InvalidTrailNameException

  • CloudTrail.Client.exceptions.CloudTrailARNInvalidException

  • CloudTrail.Client.exceptions.InvalidHomeRegionException

  • CloudTrail.Client.exceptions.InvalidInsightSelectorsException

  • CloudTrail.Client.exceptions.InsufficientS3BucketPolicyException

  • CloudTrail.Client.exceptions.InsufficientEncryptionPolicyException

  • CloudTrail.Client.exceptions.S3BucketDoesNotExistException

  • CloudTrail.Client.exceptions.KmsException

  • CloudTrail.Client.exceptions.UnsupportedOperationException

  • CloudTrail.Client.exceptions.OperationNotPermittedException

  • CloudTrail.Client.exceptions.NotOrganizationMasterAccountException

  • CloudTrail.Client.exceptions.NoManagementAccountSLRExistsException

  • CloudTrail.Client.exceptions.ThrottlingException