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/cloud_watch_logs.py
| 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[CloudWatchLogsClientConfig] = 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.
"""
def _handler(
req: "OperationRequest[capo_cloudwatch_logs.types.test_transformer_request.TestTransformerRequest]",
) -> OperationResponse[
"capo_cloudwatch_logs.types.test_transformer_response.TestTransformerResponse"
]:
import capo_cloudwatch_logs._operations.logs_20140328.test_transformer
output, http_response = (
capo_cloudwatch_logs._operations.logs_20140328.test_transformer.test_transformer(
req.options, req.input
)
)
return OperationResponse(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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|