Skip to content

Conversation

@chemamartinez
Copy link
Contributor

Proposed commit message

Fix a mapping conflict in Elasticsearch when ingesting documents with the Parameters or ModifiedProperties fields. These fields may sometimes be strings or arrays of strings instead of objects, which conflicts with the existing mapping that defines them as objects. Once a document with an object-type field is ingested, Elasticsearch will reject subsequent documents where the same field is of a different type.

(status=400): {\"type\":\"document_parsing_exception\",\"reason\":\"[1:600] object mapping for [o365audit.Parameters] tried to parse field [Parameters] as object, but found a concrete value\"}, dropping event!
(status=400): {\"type\":\"document_parsing_exception\",\"reason\":\"[1:2] object mapping for [o365audit.ModifiedProperties] tried to parse field [null] as object, but found a concrete value\"}, dropping event!

To resolve this, the PR sets subobjects: false in the mapping for these fields. This change allows Elasticsearch to handle both object and non-object values for these fields without triggering a mapping conflict.

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

@chemamartinez chemamartinez self-assigned this May 16, 2025
@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 May 16, 2025
@chemamartinez chemamartinez marked this pull request as ready for review May 16, 2025 20:33
@chemamartinez chemamartinez requested a review from a team as a code owner May 16, 2025 20:33
@elasticmachine
Copy link

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

@efd6
Copy link
Contributor

efd6 commented May 18, 2025

/test

@elastic-vault-github-plugin-prod

🚀 Benchmarks report

Package o365 👍(0) 💚(0) 💔(1)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
audit 2114.16 1404.49 -709.67 (-33.57%) 💔

To see the full report comment with /test benchmark fullreport

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @chemamartinez

@elastic-sonarqube
Copy link

@chemamartinez chemamartinez merged commit f32accf into elastic:main May 19, 2025
7 checks passed
@chemamartinez chemamartinez deleted the o365-fix-mapping-error branch May 19, 2025 07:37
@elastic-vault-github-plugin-prod

Package o365 - 2.15.2 containing this change is available at https://epr.elastic.co/package/o365/2.15.2/

anupratharamachandran pushed a commit to anupratharamachandran/integrations that referenced this pull request Jun 2, 2025
Fix a mapping conflict in Elasticsearch when ingesting documents with the Parameters or ModifiedProperties fields. These fields may sometimes be strings or arrays of strings instead of objects, which conflicts with the existing mapping that defines them as objects. Once a document with an object-type field is ingested, Elasticsearch will reject subsequent documents where the same field is of a different type.

To resolve this, the PR sets subobjects: false in the mapping for these fields. This change allows Elasticsearch to handle both object and non-object values for these fields without triggering a mapping conflict.
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.

3 participants