Skip to content

[Azure] Fix degraded auditlogs: raise keyword limits, fix missing field mappings, add pipeline tests#20132

Merged
shmsr merged 13 commits into
elastic:mainfrom
shmsr:fix/azure-auditlogs-degraded-docs
Jul 20, 2026
Merged

[Azure] Fix degraded auditlogs: raise keyword limits, fix missing field mappings, add pipeline tests#20132
shmsr merged 13 commits into
elastic:mainfrom
shmsr:fix/azure-auditlogs-degraded-docs

Conversation

@shmsr

@shmsr shmsr commented Jul 15, 2026

Copy link
Copy Markdown
Member

Proposed commit message

azure: fix degraded documents in auditlogs by raising keyword limits

Azure Entra ID audit events can contain multi-kilobyte string values in several
`azure.auditlogs` fields, especially serialized object-state diffs under
`modified_properties.*.old_value` and `modified_properties.*.new_value`.

In v1.37.0 these values can exceed the effective `ignore_above: 1024` limit from
Fleet fallback/package-generated keyword mappings. When that happens,
Elasticsearch indexes the document but ignores the oversized keyword field, adds
the field name to `_ignored`, and Kibana surfaces the event as a degraded
document.

This change reduces those degraded documents by:

  • raising ignore_above to 8191 for:
    • azure.auditlogs.result_description
    • azure.auditlogs.properties.result_reason
    • azure.auditlogs.properties.result_description (newly declared — see below)
    • azure.auditlogs.properties.additional_details.value
    • azure.auditlogs.properties.target_resources.*.modified_properties.*.*
  • normalizing top-level azure.auditlogs.resultDescription to
    azure.auditlogs.result_description in the ingest pipeline
  • replacing the per-leaf modified_properties.*.{new_value,display_name,old_value}
    declarations with a single object_type: keyword mapping on
    modified_properties.*.*
  • fixing a pre-existing gap from [Azure] [Audit Logs] Update Azure Audit Logs pipeline with support for initiated_by user fields #9701: properties.resultDescription → properties.result_description was renamed in the pipeline but the target field
    was never declared in fields.yml, leaving it unmapped since 2023
  • adding pipeline test fixtures for both resultDescription renames

The modified_properties path is a doubly-nested wildcard path
(target_resources.* -> modified_properties.*). The previous per-leaf mapping
appears to hit the same Fleet/EPM shared-section mapping-generation issue
described in elastic/kibana#270746, where only the first declared leaf receives
the intended package dynamic template and later leaves can fall through to
Fleet's fallback strings_as_keyword template.

ignore_above: 8191 is used instead of 32766 because ignore_above is
measured in characters while Lucene's hard term limit is 32,766 bytes. UTF-8
characters can use up to 4 bytes, so 32766 / 4 = 8191 is the largest safe
character limit that avoids hard document rejection for all UTF-8 input. This is
also the logsdb default for keyword fields in Elasticsearch 9.x.

This is not a field-type breaking change. The affected fields remain keyword,
so field capabilities remain compatible across old and new backing indices.
Existing documents that were already degraded are not retroactively repaired.
Existing backing indices also keep their current mappings unless their mappings
are explicitly updated; the package template change applies to new backing
indices created after upgrade.

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. No dashboards are added by this PR.

Author's Checklist

  • Raised the affected auditlogs keyword fields to ignore_above: 8191.
  • Added ingest pipeline normalization for top-level resultDescription.
  • Reworked modified_properties.* leaf mappings into one modified_properties.*.* keyword object mapping.
  • Verified the fix on a 9.x logsdb data stream.
  • Added pipeline fixture coverage for top-level resultDescription rename.
  • Added pipeline fixture coverage for properties.resultDescription rename; declared missing properties.result_description field in fields.yml.

shmsr and others added 2 commits July 15, 2026 13:45
…ded documents

Fleet's strings_as_keyword dynamic template applies ignore_above: 1024 to all
keyword fields. Azure Entra ID audit payloads routinely exceed this limit on
result_description, result_reason, additional_details.value, and the
modified_properties leaf fields (old_value/new_value/display_name), causing
those field values to be silently dropped and documents marked degraded.

Raises ignore_above to 8191 (the safe UTF-8 keyword ceiling; Lucene's hard term
limit is 32766 bytes, 32766/4 = 8191 chars) on the affected fields. The
modified_properties group is also restructured from per-leaf keyword declarations
to a single object_type: keyword template on modified_properties.*.*, working
around a Fleet/EPM limitation where only the first declared leaf under a
doubly-nested wildcard path gets its own dynamic template.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shmsr
shmsr requested review from a team as code owners July 15, 2026 08:28
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shmsr shmsr self-assigned this Jul 15, 2026
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Elastic Docs Style Checker (Vale)

Summary: 1 warning found

⚠️ Warnings (1): Fix when the suggestion improves clarity or correctness.
File Line Rule Message
packages/azure/data_stream/auditlogs/fields/fields.yml 106 Elastic.Latinisms Latin terms and abbreviations are a common source of confusion. Use 'for example' instead of 'e.g'.

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.

@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

Package azure 👍(5) 💚(1) 💔(7)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
springcloudlogs 8849.56 6172.84 -2676.72 (-30.25%) 💔
aadgraphactivitylogs 1587.3 1317.52 -269.78 (-17%) 💔
activitylogs 2320.19 1733.1 -587.09 (-25.3%) 💔
application_gateway 4784.69 3846.15 -938.54 (-19.62%) 💔
auditlogs 4784.69 3787.88 -996.81 (-20.83%) 💔
graphactivitylogs 3003 2439.02 -563.98 (-18.78%) 💔
identity_protection 9523.81 3937.01 -5586.8 (-58.66%) 💔

To see the full report comment with /test benchmark fullreport

@andrewkroh andrewkroh added documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. Integration:azure Azure Logs Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] labels Jul 15, 2026
shmsr and others added 3 commits July 16, 2026 00:31
… pipeline

The top-level resultDescription field from Azure audit log events was not
being renamed to snake_case, unlike operationName, resultSignature, and
operationVersion. The raw camelCase field landed as a dynamic mapping under
strings_as_keyword (ignore_above: 1024) while the explicit keyword mapping
for azure.auditlogs.result_description was never matched.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… fields

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shmsr shmsr changed the title [Azure] Reduce degraded documents in auditlogs by raising keyword ignore_above to 8191 [Azure] Fix degraded documents in auditlogs — raise ignore_above and normalize resultDescription Jul 16, 2026
@shmsr
shmsr requested a review from Copilot July 16, 2026 09:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR reduces “degraded documents” in the azure.auditlogs data stream by ensuring long keyword values aren’t silently dropped (via a higher ignore_above) and by normalizing the top-level resultDescription field to the correctly-mapped snake_case field name.

Changes:

  • Raise ignore_above to 8191 for selected azure.auditlogs keyword fields and for modified_properties leaf values via a wildcard object mapping.
  • Update the auditlogs ingest pipeline to rename azure.auditlogs.resultDescriptionazure.auditlogs.result_description.
  • Bump the Azure package version and update docs/changelog accordingly.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/azure/manifest.yml Bumps package version to 1.37.1.
packages/azure/docs/adlogs.md Updates exported-fields documentation for the new modified_properties.*.* mapping shape.
packages/azure/data_stream/auditlogs/fields/fields.yml Raises ignore_above to 8191 and replaces the per-leaf modified_properties mapping with a wildcard object mapping.
packages/azure/data_stream/auditlogs/elasticsearch/ingest_pipeline/default.yml Adds rename processor to normalize resultDescription to result_description.
packages/azure/changelog.yml Adds a 1.37.1 bugfix entry describing the degraded-document reduction changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@shmsr shmsr changed the title [Azure] Fix degraded documents in auditlogs — raise ignore_above and normalize resultDescription [Azure] Fix degraded documents in auditlogs by raising keyword limits Jul 16, 2026
Adds a test case exercising the resultDescription → result_description
rename processor added in the previous commit, as flagged in code review.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@shmsr
shmsr requested a review from Copilot July 20, 2026 06:24
…test

PR elastic#9701 added a pipeline rename for properties.resultDescription →
properties.result_description but never declared the field in fields.yml
or added test coverage. This adds both:

- fields.yml: declare properties.result_description as keyword/8191
- adlogs.md: add the field to the docs table
- test fixture: second event in test-auditlogs-result-description.log
  exercises the properties rename end-to-end

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated no new comments.

@shmsr shmsr changed the title [Azure] Fix degraded documents in auditlogs by raising keyword limits [Azure] Fix degraded auditlogs: raise keyword limits, fix missing field mappings, add pipeline tests Jul 20, 2026
@shmsr
shmsr requested a review from Copilot July 20, 2026 06:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated no new comments.

@shmsr

shmsr commented Jul 20, 2026

Copy link
Copy Markdown
Member Author

@elastic/obs-ds-hosted-services and @elastic/security-service-integrations could you PTAL?

@mergify

mergify Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Mention the missing properties.result_description mapping and rollover
scope in the changelog, and replace e.g. with for example.
Comment thread packages/azure/changelog.yml Outdated
@shmsr
shmsr enabled auto-merge (squash) July 20, 2026 18:06
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @shmsr

@shmsr
shmsr merged commit c947f4c into elastic:main Jul 20, 2026
8 of 10 checks passed
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. Integration:azure Azure Logs Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants