Skip to content

[azure] signinlogs: use createdDateTime as @timestamp#20287

Draft
zmoog wants to merge 4 commits into
mainfrom
azure-signinlogs-created-datetime-timestamp
Draft

[azure] signinlogs: use createdDateTime as @timestamp#20287
zmoog wants to merge 4 commits into
mainfrom
azure-signinlogs-created-datetime-timestamp

Conversation

@zmoog

@zmoog zmoog commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • For SignInLogs, properties.createdDateTime is the actual sign-in event time. The top-level time field is a processing timestamp that arrives slightly later (typically 1–2 minutes after the real event).
  • When properties.createdDateTime is present, it now overrides @timestamp; events that only carry time fall back to the existing behavior unchanged.
  • Note for users: since events are now timestamped at the actual sign-in time, they may appear 1–2 minutes earlier than with the previous behavior.

Implementation

A single set processor with copy_from and override: true overwrites azure.signinlogs.time with properties.created_date_time when present, right before the existing date processor. The date processor then handles both cases unchanged, keeping the fallback implicit with no branching logic.

Testing

  • Adds a new test fixture (test-created-datetime-timestamp.log) with two events: one carrying both fields with different values (@timestamp = createdDateTime), and one with time only (@timestamp = time, the fallback path).
  • Updates the expected output for test-alternative-time-and-duration-as-string, where the two timestamps genuinely differ: @timestamp moves from the time value (01:48:53.000Z) to the createdDateTime value (01:46:16.428Z).
  • All other existing fixtures are unaffected because their time and createdDateTime values represent the same instant.

🤖 Generated with Claude Code

@zmoog
zmoog requested a review from a team as a code owner July 22, 2026 15:56
@andrewkroh andrewkroh added Integration:azure Azure Logs Team:Obs-InfraObs Observability Infrastructure Monitoring team [elastic/obs-infraobs-integrations] labels Jul 22, 2026
For SignInLogs, `properties.createdDateTime` is the actual sign-in event
time, while the top-level `time` field is a processing timestamp that
arrives slightly later. When `createdDateTime` is present, use it for
`@timestamp`; fall back to `time` for events that only carry that field.

Adds a test fixture covering both cases (createdDateTime present vs absent).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zmoog
zmoog force-pushed the azure-signinlogs-created-datetime-timestamp branch from 1f9f751 to 8ea260a Compare July 22, 2026 16:12
@zmoog
zmoog marked this pull request as draft July 22, 2026 16:44
zmoog and others added 3 commits July 22, 2026 18:50
For the sign-in logs the `createdDateTime` field seems the expected
log event time.
Also shorten the set processor description; the comment above it
already carries the full explanation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Elastic Docs Style Checker (Vale)

Summary: 1 suggestion found

💡 Suggestions (1): Optional style improvements. Apply when helpful.
File Line Rule Message
packages/azure/changelog.yml 3 Elastic.WordChoice Consider using 'can, might' instead of 'may', unless the term is in the UI.

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

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

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

Labels

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.

2 participants