Skip to content

test_transformer async

test_transformer(
    transformer_config: Processors,
    log_event_messages: TestEventMessages,
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> TestTransformerResponse

Use this operation to test a log transformer. You enter the transformer configuration and a set of log events to test with. The operation responds with an array that includes the original log events and the transformed versions.

Parameters:

  • transformer_config (Processors) –

    This structure contains the configuration of this log transformer that you want to test. A log transformer is an array of processors, where each processor applies one type of transformation to the log events that are ingested.

  • log_event_messages (TestEventMessages) –

    An array of the raw log events that you want to use to test this transformer.

Raises:

Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
async def test_transformer(
    self,
    transformer_config: "capo_cloudwatch_logs.types.processors.Processors",
    log_event_messages: "capo_cloudwatch_logs.types.test_event_messages.TestEventMessages",
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> "capo_cloudwatch_logs.types.test_transformer_response.TestTransformerResponse":
    """<p>Use this operation to test a log transformer. You enter the transformer configuration and a set of log events to test with. The operation responds with an array that includes the original log events and the transformed versions.</p>

    Args:
        transformer_config: <p>This structure contains the configuration of this log transformer that you want to test. A log transformer is an array of processors, where each processor applies one type of transformation to the log events that are ingested.</p>
        log_event_messages: <p>An array of the raw log events that you want to use to test this transformer.</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.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.test_transformer_request.TestTransformerRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudwatch_logs.types.test_transformer_response.TestTransformerResponse"
    ]:
        import capo_cloudwatch_logs._operations.logs_20140328.test_transformer

        (
            output,
            http_response,
        ) = await capo_cloudwatch_logs._operations.logs_20140328.test_transformer.async_test_transformer(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TestTransformer")
    )
    input_: capo_cloudwatch_logs.types.test_transformer_request.TestTransformerRequest = {
        "transformer_config": transformer_config,
        "log_event_messages": log_event_messages,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output