Skip to content

get_log_record

get_log_record(
    log_record_pointer: LogRecordPointer,
    *,
    config_overrides: Optional[CloudWatchLogsClientConfig] = None,
    unmask: Optional[Unmask] = None,
) -> GetLogRecordResponse

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.

Parameters:

  • log_record_pointer (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.

  • unmask (Optional[Unmask], default: None ) –

    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.

Raises:

Source code in docs_src/capo_cloudwatch_logs/_services/cloud_watch_logs.py
def get_log_record(
    self,
    log_record_pointer: "capo_cloudwatch_logs.types.log_record_pointer.LogRecordPointer",
    *,
    config_overrides: Optional[CloudWatchLogsClientConfig] = None,
    unmask: Optional["capo_cloudwatch_logs.types.unmask.Unmask"] = None,
) -> "capo_cloudwatch_logs.types.get_log_record_response.GetLogRecordResponse":
    """<p>Retrieves all of the fields and values of a single log event. All fields are retrieved, even if the original query that produced the <code>logRecordPointer</code> retrieved only a subset of fields. Fields are returned as field name/field value pairs.</p> <p>The full unparsed log event is returned within <code>@message</code>.</p>

    Args:
        log_record_pointer: <p>The pointer corresponding to the log event record you want to retrieve. You get this from the response of a <code>GetQueryResults</code> operation. In that response, the value of the <code>@ptr</code> field for a log event is the value to use as <code>logRecordPointer</code> to retrieve that complete log event record.</p>
        unmask: <p>Specify <code>true</code> to display the log event fields with all sensitive data unmasked and visible. The default is <code>false</code>.</p> <p>To use this operation with this parameter, you must be signed into an account with the <code>logs:Unmask</code> permission.</p>

    Raises:
        capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
        capo_cloudwatch_logs.errors.limit_exceeded_exception.LimitExceededException: <p>You have reached the maximum number of resources that can be created.</p>
        capo_cloudwatch_logs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</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.get_log_record_request.GetLogRecordRequest]",
    ) -> OperationResponse[
        "capo_cloudwatch_logs.types.get_log_record_response.GetLogRecordResponse"
    ]:
        import capo_cloudwatch_logs._operations.logs_20140328.get_log_record

        output, http_response = (
            capo_cloudwatch_logs._operations.logs_20140328.get_log_record.get_log_record(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetLogRecord")
    )
    input_: capo_cloudwatch_logs.types.get_log_record_request.GetLogRecordRequest = {
        "log_record_pointer": log_record_pointer
    }
    if unmask is not None:
        input_["unmask"] = unmask

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output