Returns a list of field indexes discovered in log data. By default, the response includes the DEFAULT, CUSTOM, and INACTIVE index categories. To return indexes from other categories, use the indexCategories parameter.
For more information about field index policies, see PutIndexPolicy.
Parameters:
-
log_group_identifiers
(DescribeFieldIndexesLogGroupIdentifiers)
–
An array containing the names or ARNs of the log groups that you want to retrieve field indexes for.
-
index_categories
(Optional[IndexCategories], default:
None
)
–
The index categories to return. The following values are supported:
-
DEFAULT: Fields that CloudWatch Logs indexes by default. Examples include @logStream and @data_format.
-
CUSTOM: Fields that you added manually to the field index policy. CloudWatch Logs always indexes these fields. These fields count toward the quota of 20 fields for each log group.
-
AUTO: Fields that CloudWatch Logs indexes automatically based on your query patterns and usage. These fields do not count toward the field index quota. CloudWatch Logs might update these fields based on changes in your query patterns. To keep a field indexed permanently, add it to an account-level or log-group level field index policy.
-
INACTIVE: Fields that CloudWatch Logs indexed before but does not index now. This happens if you remove a field from the field index policy or if CloudWatch Logs automatically selects a different field based on your queries.
If you omit this parameter, the response includes the DEFAULT, CUSTOM, and INACTIVE categories.
For more information about automatically indexed fields and using the AUTO category, see Automatically indexed fields.
Raises:
Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
| async def describe_field_indexes(
self,
log_group_identifiers: "capo_cloudwatch_logs.types.describe_field_indexes_log_group_identifiers.DescribeFieldIndexesLogGroupIdentifiers",
*,
config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
index_categories: Optional[
"capo_cloudwatch_logs.types.index_categories.IndexCategories"
] = None,
next_token: Optional["capo_cloudwatch_logs.types.next_token.NextToken"] = None,
) -> "capo_cloudwatch_logs.types.describe_field_indexes_response.DescribeFieldIndexesResponse":
"""<p>Returns a list of field indexes discovered in log data. By default, the response includes the <code>DEFAULT</code>, <code>CUSTOM</code>, and <code>INACTIVE</code> index categories. To return indexes from other categories, use the <code>indexCategories</code> parameter.</p> <p>For more information about field index policies, see <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutIndexPolicy.html">PutIndexPolicy</a>.</p>
Args:
log_group_identifiers: <p>An array containing the names or ARNs of the log groups that you want to retrieve field indexes for.</p>
index_categories: <p>The index categories to return. The following values are supported:</p> <ul> <li> <p> <code>DEFAULT</code>: Fields that CloudWatch Logs indexes by default. Examples include <code>@logStream</code> and <code>@data_format</code>.</p> </li> <li> <p> <code>CUSTOM</code>: Fields that you added manually to the field index policy. CloudWatch Logs always indexes these fields. These fields count toward the quota of 20 fields for each log group.</p> </li> <li> <p> <code>AUTO</code>: Fields that CloudWatch Logs indexes automatically based on your query patterns and usage. These fields do not count toward the field index quota. CloudWatch Logs might update these fields based on changes in your query patterns. To keep a field indexed permanently, add it to an account-level or log-group level field index policy.</p> </li> <li> <p> <code>INACTIVE</code>: Fields that CloudWatch Logs indexed before but does not index now. This happens if you remove a field from the field index policy or if CloudWatch Logs automatically selects a different field based on your queries.</p> </li> </ul> <p>If you omit this parameter, the response includes the <code>DEFAULT</code>, <code>CUSTOM</code>, and <code>INACTIVE</code> categories.</p> <p>For more information about automatically indexed fields and using the <code>AUTO</code> category, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing-Automatic.html">Automatically indexed fields</a>.</p>
Raises:
capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
capo_cloudwatch_logs.errors.limit_exceeded_exception.LimitExceededException: <p>You have reached the maximum number of resources that can be created.</p>
capo_cloudwatch_logs.errors.operation_aborted_exception.OperationAbortedException: <p>Multiple concurrent requests to update the same resource were in conflict.</p>
capo_cloudwatch_logs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
capo_cloudwatch_logs.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service cannot complete the request.</p>
capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudwatch_logs.types.describe_field_indexes_request.DescribeFieldIndexesRequest]",
) -> AsyncOperationResponse[
"capo_cloudwatch_logs.types.describe_field_indexes_response.DescribeFieldIndexesResponse"
]:
import capo_cloudwatch_logs._operations.logs_20140328.describe_field_indexes
(
output,
http_response,
) = await capo_cloudwatch_logs._operations.logs_20140328.describe_field_indexes.async_describe_field_indexes(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeFieldIndexes")
)
input_: capo_cloudwatch_logs.types.describe_field_indexes_request.DescribeFieldIndexesRequest = {
"log_group_identifiers": log_group_identifiers
}
if index_categories is not None:
input_["index_categories"] = index_categories
if next_token is not None:
input_["next_token"] = next_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|