getLogObject method

Future<GetLogObjectResponse> getLogObject({
  1. required String logObjectPointer,
  2. bool? unmask,
})

Retrieves a large logging object (LLO) and streams it back. This API is used to fetch the content of large portions of log events that have been ingested through the PutOpenTelemetryLogs API. When log events contain fields that would cause the total event size to exceed 1MB, CloudWatch Logs automatically processes up to 10 fields, starting with the largest fields. Each field is truncated as needed to keep the total event size as close to 1MB as possible. The excess portions are stored as Large Log Objects (LLOs) and these fields are processed separately and LLO reference system fields (in the format @ptr.$[path.to.field]) are added. The path in the reference field reflects the original JSON structure where the large field was located. For example, this could be @ptr.$['input']['message'], @ptr.$['AAA']['BBB']['CCC']['DDD'], @ptr.$['AAA'], or any other path matching your log structure.

May throw AccessDeniedException. May throw InvalidOperationException. May throw InvalidParameterException. May throw LimitExceededException. May throw ResourceNotFoundException.

Parameter logObjectPointer : A pointer to the specific log object to retrieve. This is a required parameter that uniquely identifies the log object within CloudWatch Logs. The pointer is typically obtained from a previous query or filter operation.

Parameter unmask : A boolean flag that indicates whether to unmask sensitive log data. When set to true, any masked or redacted data in the log object will be displayed in its original form. Default is false.

Implementation

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

  return GetLogObjectResponse.fromJson(jsonResponse.body);
}