Repository navigation
[microsoft_intune] Fix date formats for T-separated ISO 8601 timestamps. - #20656
Merged
chemamartinez merged 2 commits intoAug 13, 2026
Merged
chemamartinez merged 2 commits into
chemamartinez merged 2 commits into
Conversation
Contributor
✅ Elastic Docs Style Checker (Vale)No issues found on modified lines! The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
Contributor
|
✅ All changelog entries have the correct PR link. |
chemamartinez
marked this pull request as ready for review
August 11, 2026 12:19
Contributor
🚀 Benchmarks reportTo see the full report comment with |
💚 Build Succeeded
|
efd6
approved these changes
Aug 12, 2026
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
Contributor
|
Package microsoft_intune - 0.1.1 containing this change is available at https://epr.elastic.co/package/microsoft_intune/0.1.1/ |
6 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Executive summary
The managed_device ingest pipeline failed to parse date fields (InGracePeriodUntil, LastContact, CreatedDate) when Microsoft Intune delivered them in T-separated ISO 8601 format (e.g., '2026-06-26T16:57:05.0858748') instead of the space-separated format ('2026-06-26 16:57:05.0858748') the pipeline previously handled. The fix adds the 'yyyy-MM-dd'T'HH:mm:ss.SSSSSSS' format as a second accepted pattern in all three date processors, allowing both variants to parse correctly. A new pipeline test fixture exercising the T-separated variant was added and all tests pass.
Proposed commit message
Root cause
The three date processors (date_properties_InGracePeriodUntil, date_properties_LastContact, date_properties_CreatedDate) declare only the space-separated format 'yyyy-MM-dd HH:mm:ss.SSSSSSS', but Microsoft Intune DeviceComplianceOrg/DeviceCompliance category events send these fields in T-separated ISO 8601 format (e.g. '9999-12-31T23:59:59.9999999'), which does not match the declared format and causes the processor to fail.
Approach
Add 'yyyy-MM-dd'T'HH:mm:ss.SSSSSSS' as a second entry in the formats list for all three date processors in default.yml: date_properties_InGracePeriodUntil (line 158), date_properties_LastContact (line 184), and date_properties_CreatedDate (line 82). The existing space-separated format covers the Devices category; the T-separated variant covers DeviceComplianceOrg/DeviceCompliance events from the same stream. Add the sanitized DeviceComplianceOrg event as a new pipeline test fixture to exercise all three T-separated date fields.
Implementation
Pipeline changes
Field / mapping changes
—
Sanitized error message
Processor date with tag date_properties_InGracePeriodUntil in pipeline logs-microsoft_intune.managed_device-default failed with message: [on_failure_message]Sanitized log (
event_sanitizedexcerpt){ "category": "DeviceComplianceOrg", "operationName": "DeviceCompliance", "properties": { "AADTenantId": "89a1d5c1-2b3e-4f67-8a9b-0c1d2e3f4a5b", "AccountId": "89a1d5c2-2b3e-4f67-8a9b-0c1d2e3f4a5c", "BatchId": "89a1d5c3-2b3e-4f67-8a9b-0c1d2e3f4a5d", "ComplianceState": "1", "ComplianceState_loc": "Compliant", "DeviceHealthThreatLevel": null, "DeviceHealthThreatLevel_loc": "Unknown", "DeviceId": "89a1d5c4-2b3e-4f67-8a9b-0c1d2e3f4a5e", "DeviceName": "DEVICE-001", "DeviceType": 1, "IMEI": "", "InGracePeriodUntil": "9999-12-31T23:59:59.9999999", "IntuneAccountId": "89a1d5c2-2b3e-4f67-8a9b-0c1d2e3f4a5c", "LastContact": "2026-06-26T16:57:05.0858748", "ManagementAgents": 514, "ManagementAgents_loc": "Not Available", "OS": "Windows", "OSDescription": "Windows", "OSVersion": "10.0.26200.8655", "OS_loc": "Windows", "OwnerType": 1, "OwnerType_loc": "Company", "RetireAfterDatetime": null, "SerialNumber": "SN000000000001", "UPN": "user@example.com", "UserEmail": "user@example.com", "UserId": "89a1d5c5-2b3e-4f67-8a9b-0c1d2e3f4a5f", "UserName": "Alice Johnson" }, "resultType": "None", "tenantId": "89a1d5c1-2b3e-4f67-8a9b-0c1d2e3f4a5b", "time": "2026-06-27T01:36:30.5799000Z" }Reviewer concerns
SSSSSSS(7-digit sub-second) format pattern is used for both variants; if Microsoft Intune ever emits fewer than 7 fractional digits in the T-separated format (e.g., milliseconds only), parsing would still fail and a follow-up format entry would be needed.https://github.com/elastic/integrations/pull/1) and should be updated to the actual PR URL before merging.Self-review findings
—
Risk and classification
Links
ac2781af484c6b8d