Technology Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Florian_Kube
Participant
1,349

The Challenge

The CPI environment uses External Logging to send logs to Splunk. There, the LastError field is readily available:

SCR-20251127-pbgl-2.png

Important: The LastError field is also populated for messages with status COMPLETED - when an error was caught and handled properly in the iFlow. This is valuable for monitoring because you can see errors that were gracefully handled and potentially returned to the sender system, even though the message processing itself succeeded.

However, when querying the OData v2 API (/api/v1/MessageProcessingLogs), this field is not exposed. The ErrorInformation is only available as a deferred navigation property:

{
  "ErrorInformation": {
    "__deferred": {
      "uri": ".../MessageProcessingLogErrorInformations('guid')"
    }
  }
}

What I Tested

$expand=ErrorInformation

GET /MessageProcessingLogs?$expand=ErrorInformation

Result: 501 Not Implemented

This is the most obvious approach, but CPI doesn't support it. There are SAP Influence requests for this:

$select=LastError

GET /MessageProcessingLogs('guid')?$select=MessageGuid,LastError,Status

Result: Field not available in API response

The LastError field exists internally (Splunk receives it), but is not exposed via OData.

OData $batch Request

POST /$batch
Content-Type: multipart/mixed; boundary=batch_123

Result: 404 - The $batch endpoint doesn't exist for MessageProcessingLogErrorInformations

What Works

The only method I found is calling each message individually:

GET /MessageProcessingLogErrorInformations('MessageGuid')/$value

This returns the plain text error message. But for thousands of messages, this means thousands of API calls.

Open Question

I'm currently using parallel HTTP requests as a workaround, but it feels inefficient when Splunk already receives this data automatically via External Logging.

Has anyone found a better approach? Maybe there's an undocumented feature or a way to access the External Logging stream directly?

Let me know in the comments!