Skip to content

Conversation

@zmoog
Copy link
Contributor

@zmoog zmoog commented Jan 21, 2026

Proposed commit message

Add an explicit check on ctx.routing?.category to make sure it's not null before calling the endsWith("SignInLogs") method.

We can't assume category is always set.

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

How to test this PR locally

Related issues

We can't assume category will not be null.
@zmoog zmoog self-assigned this Jan 21, 2026
@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

The `?` seems to work when checking field access, but not when
checking field access 🤔
@zmoog zmoog added Integration:azure Azure Logs bugfix Pull request that fixes a bug issue Team:obs-ds-hosted-services Observability Hosted Services team [elastic/obs-ds-hosted-services] labels Jan 21, 2026
@zmoog zmoog marked this pull request as ready for review January 21, 2026 17:50
@zmoog zmoog requested a review from a team as a code owner January 21, 2026 17:50
@zmoog zmoog requested review from a team as code owners January 21, 2026 17:53
@elasticmachine
Copy link

💚 Build Succeeded

History

cc @zmoog

@zmoog zmoog added Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels Jan 21, 2026
@elasticmachine
Copy link

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

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.

nit only

value: azure.signinlogs
# Use same logic as the `signinlogs` stream that drops any document that doesn't end with `SignInLogs`.
if: 'ctx.routing?.category.endsWith("SignInLogs")'
if: 'ctx.routing?.category != null && ctx.routing?.category.endsWith("SignInLogs")'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if: 'ctx.routing?.category != null && ctx.routing?.category.endsWith("SignInLogs")'
if: 'ctx.routing?.category != null && ctx.routing.category.endsWith("SignInLogs")'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does this pipeline guarantee the routing field? It looks like it might be optional here.

value: azure.signinlogs
# Use same logic as the `signinlogs` stream that drops any document that doesn't end with `SignInLogs`.
if: 'ctx.routing?.category.endsWith("SignInLogs")'
if: 'ctx.routing?.category != null && ctx.routing?.category.endsWith("SignInLogs")'
Copy link
Contributor

Choose a reason for hiding this comment

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

If we are not processing the logs with no category then should we drop the event which doesn't have category?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Um, I think we keep the log events.

Two reasons:

  • Azure has been inconsistent in naming the field that contains the log category. So far we know they mostly usage category, but also found Category and CategoryValue in the wild. So I guess an suboptimal indexing is better than losing the log event.
  • custom routing: we recently added routing.category as candidate field for custom routing, but users may want to customize the routing based on other criteria and fields. If we drop the log event in the main pipeline, it will never reach the custom pipeline.

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:azure Azure Logs Team:obs-ds-hosted-services Observability Hosted Services team [elastic/obs-ds-hosted-services] Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] 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.

[Azure Logs]: Null def reference on set processor

6 participants