[9.4](backport #51781) Osquerybeat: emit pack_name and query_name in scheduled query results#51902
Conversation
…#51781) Scheduled pack queries (both osquery native interval schedules and osquerybeat RRULE schedules) now include pack_name and query_name in their result and response documents. pack_name comes from a new optional `pack_name` config field on a pack (alongside the existing pack_id); query_name comes from the pack's queries config map key. Both fields are only emitted when set. These fields are required by the Osquery Manager dashboards, which group and label scheduled query results by pack and query name. (cherry picked from commit 5d82c71) # Conflicts: # x-pack/osquerybeat/beater/config_plugin.go # x-pack/osquerybeat/beater/recurrence_query_handler.go # x-pack/osquerybeat/internal/config/osquery.go
|
Cherry-pick of 5d82c71 has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
🤖 GitHub commentsJust comment with:
|
|
Pinging @elastic/sec-windows-platform (Team:Security-Windows Platform) |
TL;DRBuild 49324 is failing because the 9.4 backport branch is left in an unresolved cherry-pick state. The same conflict is reported by both jobs: pre-commit finds conflict markers, while Remediation
Investigation detailsRoot CauseThe cherry-pick status in the existing PR comment identifies Evidence
VerificationNo code changes were made and no additional tests were run; the diagnosis is based on the captured Buildkite logs, PR #51902 metadata/diff, and the checked-out source tree. What is this? | From workflow: PR Buildkite Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
Keep only the additive pack_name/query_name changes; drop the RRULE scheduler handler and other main-only pieces (profiling resolution, schedule mode validation, pack schedule defaults) that do not exist on the 9.4 base.
TL;DRThe Remediation
Investigation detailsRoot CauseThe workflow runs Evidence
ValidationNo tests were run by this read-only detective workflow. All three CI jobs completed the same failing lint step. Follow-upThe earlier Buildkite detective comment on this PR reported unresolved backport conflicts; this report covers the separate, current golangci-lint failure and does not repeat that diagnosis. What is this? | From workflow: PR Actions Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
Proposed commit message
Emit
pack_nameandquery_namein osquerybeat scheduled query results.WHAT:
pack_nameconfig field to packs, next to the existingpack_id.handleQueryResult) and osquerybeat RRULE schedules (recurrenceQueryHandler) — now include two additional fields in their result documents and their synthetic response documents:pack_name: from the newpack_namepack config field.query_name: from the pack'squeriesconfig map key.QueryInfoand emitted only when set. Live/ad-hoc queries are unaffected (they emit neither).WHY:
The Osquery Manager dashboards group and label scheduled query results by pack and query name. Without
pack_name/query_nameon the documents, those dashboards cannot render scheduled pack results correctly.Checklist
./changelog/fragmentsusing the changelog tool.Disruptive User Impact
None. The
pack_namefield is opt-in and both fields are additive; documents without the new config keep their previous shape.pack_idand the existing correlation fields are unchanged.How to test this PR locally
pack_nameand one or more scheduled queries (native interval and/orrrule_schedule):osquery_manager.resultdocuments includepack_name: "My Pack"andquery_name: "uptime", and theosquery_manager.action.responsessynthetic response document includes the same fields.pack_name/query_name.Related issues
Use cases
pack_name/query_namefields.This is an automatic backport of pull request #51781 done by [Mergify](https://mergify.com).