Multiple users reported failures in ingesting Message Trace logs using the Splunk Add-on for Microsoft Office 365. This issue persists across various configurations where users have set query window sizes under 60 minutes. Analysis shows that the ingestion process fails when the add-on receives an incorrect @odata.nextLink URL in the response from Microsoft’s API, leading to repeated HTTP 500 errors.
Log analysis confirms that the add-on initiates data collection correctly and iterates over the paginated results. Microsoft typically includes a nextLink URL to retrieve subsequent pages, but occasionally provides a malformed or incorrect URL. These faulty URLs deviate from the expected format (.../reportingwebservice/reporting.svc/MessageTrace) and instead point to an incomplete or invalid endpoint, causing the ingestion process to fail with a "Max retries exceeded" error.
This behavior appears intermittent but consistent in all failing instances, rendering the ingestion process unreliable and incomplete.
While reviewing the issue and applying an SPL query for investigation:
index=_internal datainput=<input name> ERROR
After running the SPL search, the following error has been reported along with an explanation for error inspection and understanding:
"2025-05-03 06:05:59,854 level=INFO pid=11562 tid=MainThread logger=splunk_ta_o365.modinputs.message_trace pos=__init__.py:_get_events_continuous:228 | datainput=""sbux_o365_messagetrace"" start_time=1746252322 | message=""Collecting the data between Start date: 2025-05-02 14:32:55.331956, End date: 2025-05-02 14:37:55.331956""
"2025-05-03 06:06:03,554 level=DEBUG pid=11562 tid=MainThread logger=splunk_ta_o365.modinputs.message_trace pos=__init__.py:_process_messages:466 | datainput=""sbux_o365_messagetrace"" start_time=1746252322 | message=""nextLink URL (@odata.nextLink): https://reports.office365.com/ecp/reportingwebservice/reporting.svc/MessageTrace?$filter=StartDate%20eq%20datetime'2025-05-02T14%3A32%3A55.331956Z'%20and%20EndDate%20eq%20datetime'2025-05-02T14%3A37%3A55.331956Z'&$skiptoken=1999"" ",
"2025-05-03 06:06:08,726 level=DEBUG pid=11562 tid=MainThread logger=splunk_ta_o365.modinputs.message_trace pos=__init__.py:_process_messages:466 | datainput=""sbux_o365_messagetrace"" start_time=1746252322 | message=""nextLink URL (@odata.nextLink): https://reports.office365.com/ecp/reportingwebservice/reporting.svc/MessageTrace?$filter=StartDate%20eq%20datetime'2025-05-02T14%3A32%3A55.331956Z'%20and%20EndDate%20eq%20datetime'2025-05-02T14%3A37%3A55.331956Z'&$skiptoken=3999"" ",
"2025-05-03 06:06:13,853 level=DEBUG pid=11562 tid=MainThread logger=splunk_ta_o365.modinputs.message_trace pos=__init__.py:_process_messages:466 | datainput=""sbux_o365_messagetrace"" start_time=1746252322 | message=""nextLink URL (@odata.nextLink): https://reports.office365.com/ecp/MessageTrace?$filter=StartDate%20eq%20datetime'2025-05-02T14%3A32%3A55.331956Z'%20and%20EndDate%20eq%20datetime'2025-05-02T14%3A37%3A55.331956Z'&$skiptoken=5999"" ",
"2025-05-03 06:06:19,995 level=ERROR pid=11562 tid=MainThread logger=splunk_ta_o365.modinputs.message_trace pos=__init__.py:run:588 | datainput=""sbux_o365_messagetrace"" start_time=1746252322 | message=""An error occurred while collecting data"" stack_info=True
ERROR_TRACEBACK
requests.exceptions.RetryError: HTTPSConnectionPool(host='reports.office365.com', port=443): Max retries exceeded with url: /ecp/MessageTrace?$filter=StartDate%20eq%20datetime'2025-05-02T14%3A32%3A55.331956Z'%20and%20EndDate%20eq%20datetime'2025-05-02T14%3A37%3A55.331956Z'&$skiptoken=5999 (Caused by ResponseError('too many 500 error responses'))",
Here's the another example:
"2025-05-02 03:55:00,174 level=INFO pid=30478 tid=MainThread logger=splunk_ta_o365.modinputs.message_trace pos=__init__.py:_get_events_continuous:229 | datainput=b'sbux_o365_messagetrace' start_time=1746158099 | message=""Collecting the data between Start date: 2025-05-02 02:47:55.331956, End date: 2025-05-02 02:52:55.331956""
"2025-05-02 03:55:00,517 level=INFO pid=30478 tid=MainThread logger=splunk_ta_o365.common.portal pos=portal.py:get_messagetrace_token_by_psk:258 | datainput=b'sbux_o365_messagetrace' start_time=1746158099 | message=""Acquire access token success."" expires_on=1746161699.5169265"
"2025-05-02 03:55:03,839 level=DEBUG pid=30478 tid=MainThread logger=splunk_ta_o365.modinputs.message_trace pos=__init__.py:_process_messages:464 | datainput=b'sbux_o365_messagetrace' start_time=1746158099 | message=""nextLink URL (@odata.nextLink): https://reports.office365.com/ecp/reportingwebservice/reporting.svc/MessageTrace?$filter=StartDate%20eq%20datetime'2025-05-02T02%3A47%3A55.331956Z'%20and%20EndDate%20eq%20datetime'2025-05-02T02%3A52%3A55.331956Z'&$skiptoken=1999"" "
"2025-05-02 03:55:12,066 level=DEBUG pid=30478 tid=MainThread logger=splunk_ta_o365.modinputs.message_trace pos=__init__.py:_process_messages:464 | datainput=b'sbux_o365_messagetrace' start_time=1746158099 | message=""nextLink URL (@odata.nextLink): https://reports.office365.com/ecp/MessageTrace?$filter=StartDate%20eq%20datetime'2025-05-02T02%3A47%3A55.331956Z'%20and%20EndDate%20eq%20datetime'2025-05-02T02%3A52%3A55.331956Z'&$skiptoken=3999"" "
ERROR: Max retries exceeded with url: /ecp/MessageTrace?$filter=StartDate%20eq%20datetime'2025-05-02T02%3A47%3A55.331956Z'%20and%20EndDate%20eq%20datetime'2025-05-02T02%3A52%3A55.331956Z'&$skiptoken=3999 (Caused by ResponseError('too many 500 error responses'))"
The issue stems from the Microsoft API returning inconsistent or malformed @odata.nextLink values. As this behavior originates from the upstream service, it is recommended to reduce the query_window_size. This adjustment will decrease the data load in each chunk and minimize the number of pages to skip in the event of a failure.
| Revision | Publish Date | Comments |
|---|---|---|
1.0 |
01-Oct-2026
|
Initial Release |