Skip to content

CloudWatchLogsClient.put_index_policy

rboto-cloudwatch-logs==0.4.0 · Service index · Types

Model summary (excerpt): Creates or updates a field index policy for the specified log group. Only log groups in the Standard log class support field index policies. For more information about log classes, see Log classes . You can use field index policies to create field indexes on fields found in log events in the log group. Creating field indexes speeds up and lowers the costs for CloudWatch Logs Insights queries...

Install and imports

python -m pip install "rboto[cloudwatch-logs]==0.4.0"
from rboto import CloudWatchLogsClient
from rboto_cloudwatch_logs.types import (
    PutIndexPolicyOutput,
)

Signature

async def put_index_policy(
    *,
    log_group_identifier: str,
    policy_document: str,
) -> PutIndexPolicyOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
log_group_identifier Yes Specify either the log group name or log group ARN to apply this field index policy to. If you specify an ARN, use the format arn:aws:logs: region : account-id :log-group: log_group_name Don't include an * at the end.
policy_document Yes The index policy document, in JSON format. The following is an example of an index policy document that creates indexes with different types. "policyDocument": "{"Fields": [ "TransactionId" ], "FieldsV2": {"RequestId": {"type": "FIELD_INDEX"}, "APIName": {"type": "FACET"}, "StatusCode": {"type": "FACET"}}}" You can use FieldsV2 to specify the type for each field. Supported types are...

Output

PutIndexPolicyOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
index_policy IndexPolicyOutput | None Always present IndexPolicyOutput

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

PutIndexPolicyOutput

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_cloudwatch_logs.exceptions:

InvalidParameterError, LimitExceededError, OperationAbortedError, ResourceNotFoundError, ServiceUnavailableError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model