Skip to content

Conversation

@chemamartinez
Copy link
Contributor

Proposed commit message

For some unknown reason we couldn't find out, some events from O365 introduces a malformed JSON object by adding a duplicated QueryTime field. The pattern this issue follows is:

  • It only affects events with RecordType == 64
  • The undesired QueryTime field doesn't follow ISO8601 format.

So the pipeline fails with:

"error": {
      "message": [
        "Duplicate field 'QueryTime'\n at [Source: (String)\"{\"Version\":\"3.0\",\"VendorName\":\"Microsoft\"...\"[truncated 11497 chars]; line: 1, column: 5099]"
      ]
}

To fix the error it was added a gsub processor that attempts to find the undesired QueryTime field and removed from the whole Data object. In addition, to prevent other similar issues, added a on_failure case when decoding the Data field which generally contains unknown fields.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Related issues

@chemamartinez chemamartinez added Integration:o365 Microsoft Office 365 bugfix Pull request that fixes a bug issue Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels Oct 23, 2024
@chemamartinez chemamartinez self-assigned this Oct 23, 2024
@chemamartinez chemamartinez marked this pull request as ready for review October 23, 2024 14:55
@chemamartinez chemamartinez requested a review from a team as a code owner October 23, 2024 14:55
@elasticmachine
Copy link

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@elastic-sonarqube
Copy link

@elasticmachine
Copy link

💚 Build Succeeded

cc @chemamartinez

Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are not technically wrong; RFC 8259 only says that "The names within an object SHOULD be unique." (section 4). Not nice though. (RFC 7493 does prohibit this.)

@chemamartinez chemamartinez merged commit bcca49b into elastic:main Oct 24, 2024
5 checks passed
@elastic-vault-github-plugin-prod

Package o365 - 2.6.5 containing this change is available at https://epr.elastic.co/search?package=o365

harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 4, 2025
Some events from O365 introduce a duplicated QueryTime field. To fix the error it was added a gsub processor that attempts to find the undesired QueryTime field and removed from the whole Data object. In addition, to prevent other similar issues, added a on_failure case when decoding the Data field which generally contains unknown fields.
harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 5, 2025
Some events from O365 introduce a duplicated QueryTime field. To fix the error it was added a gsub processor that attempts to find the undesired QueryTime field and removed from the whole Data object. In addition, to prevent other similar issues, added a on_failure case when decoding the Data field which generally contains unknown fields.
@chemamartinez chemamartinez deleted the fix-o365-duplicated-querytime branch February 6, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a bug issue Integration:o365 Microsoft Office 365 Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Microsoft 365] Pipeline failure resulting in incorrect root-level fields

3 participants