Skip to content

get_transformer

get_transformer(
    log_group_identifier: LogGroupIdentifier,
    *,
    config_overrides: Optional[CloudWatchLogsClientConfig] = None,
) -> GetTransformerResponse

Returns the information about the log transformer associated with this log group.

This operation returns data only for transformers created at the log group level. To get information for an account-level transformer, use DescribeAccountPolicies.

Parameters:

  • log_group_identifier (LogGroupIdentifier) –

    Specify either the name or ARN of the log group to return transformer information for. If the log group is in a source account and you are using a monitoring account, you must use the log group ARN.

Raises:

Source code in docs_src/capo_cloudwatch_logs/_services/cloud_watch_logs.py
def get_transformer(
    self,
    log_group_identifier: "capo_cloudwatch_logs.types.log_group_identifier.LogGroupIdentifier",
    *,
    config_overrides: Optional[CloudWatchLogsClientConfig] = None,
) -> "capo_cloudwatch_logs.types.get_transformer_response.GetTransformerResponse":
    """<p>Returns the information about the log transformer associated with this log group.</p> <p>This operation returns data only for transformers created at the log group level. To get information for an account-level transformer, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeAccountPolicies.html">DescribeAccountPolicies</a>.</p>

    Args:
        log_group_identifier: <p>Specify either the name or ARN of the log group to return transformer information for. If the log group is in a source account and you are using a monitoring account, you must use the log group ARN.</p>

    Raises:
        capo_cloudwatch_logs.errors.invalid_operation_exception.InvalidOperationException: <p>The operation is not valid on the specified resource.</p>
        capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</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.
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatch_logs.types.get_transformer_request.GetTransformerRequest]",
    ) -> OperationResponse[
        "capo_cloudwatch_logs.types.get_transformer_response.GetTransformerResponse"
    ]:
        import capo_cloudwatch_logs._operations.logs_20140328.get_transformer

        output, http_response = (
            capo_cloudwatch_logs._operations.logs_20140328.get_transformer.get_transformer(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetTransformer")
    )
    input_: capo_cloudwatch_logs.types.get_transformer_request.GetTransformerRequest = {
        "log_group_identifier": log_group_identifier
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output