getLogRecord method

Future<GetLogRecordResponse> getLogRecord({
  1. required String logRecordPointer,
  2. bool? unmask,
})

Retrieves all of the fields and values of a single log event. All fields are retrieved, even if the original query that produced the logRecordPointer retrieved only a subset of fields. Fields are returned as field name/field value pairs.

The full unparsed log event is returned within @message.

May throw InvalidParameterException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw ServiceUnavailableException.

Parameter logRecordPointer : The pointer corresponding to the log event record you want to retrieve. You get this from the response of a GetQueryResults operation. In that response, the value of the @ptr field for a log event is the value to use as logRecordPointer to retrieve that complete log event record.

Parameter unmask : Specify true to display the log event fields with all sensitive data unmasked and visible. The default is false.

To use this operation with this parameter, you must be signed into an account with the logs:Unmask permission.

Implementation

Future<GetLogRecordResponse> getLogRecord({
  required String logRecordPointer,
  bool? unmask,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Logs_20140328.GetLogRecord'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'logRecordPointer': logRecordPointer,
      if (unmask != null) 'unmask': unmask,
    },
  );

  return GetLogRecordResponse.fromJson(jsonResponse.body);
}