testTransformer method

Future<TestTransformerResponse> testTransformer({
  1. required List<String> logEventMessages,
  2. required List<Processor> transformerConfig,
})

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.

May throw InvalidOperationException. May throw InvalidParameterException. May throw ServiceUnavailableException.

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

Parameter transformerConfig : 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.

Implementation

Future<TestTransformerResponse> testTransformer({
  required List<String> logEventMessages,
  required List<Processor> transformerConfig,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Logs_20140328.TestTransformer'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'logEventMessages': logEventMessages,
      'transformerConfig': transformerConfig,
    },
  );

  return TestTransformerResponse.fromJson(jsonResponse.body);
}