Repository navigation
Conversation
Osquerybeat reports a failed action as a top-level "error" string, and the action_responses data stream mapped it as text with a keyword multi-field. ECS defines "error" as an object, so any search that spans this data stream and ECS-conformant indices sees a text vs object conflict on "error". Rename a string "error" to "error.message" in the ingest pipeline and map "error.message" from ECS. Documents that already carry an "error" object are left alone, so a future osquerybeat that writes "error.message" itself keeps working. This is a breaking change: queries, visualizations and rules that use "error" or "error.keyword" on this data stream must move to "error.message". The Kibana osquery plugin reads "error.keyword" to decide per-agent success or failure, so this package must require a Kibana version that reads "error.message". Assisted-By: Claude Code
Assisted-By: Claude Code
Contributor
|
✅ All changelog entries have the correct PR link. |
Contributor
✅ Elastic Docs Style Checker (Vale)No issues found on modified lines! 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. |
💔 Build Failed
Failed CI StepsHistory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
Draft. Do not merge until elastic/kibana#307730 is in a Kibana release and
conditions.kibana.versionis raised to that release.Proposed commit message
osquery_manager: map action responses error to ECS error.message
Osquerybeat reports a failed action as a top-level
errorstring, andthe
action_responsesdata stream mapped it astextwith akeywordmulti-field. ECS defines
erroras an object, so any search that spansthis data stream and ECS-conformant indices sees a text vs object
conflict on
error.Rename a string
errortoerror.messagein the ingest pipeline andmap
error.messagefrom ECS. Documents that already carry anerrorobject are left alone, so a future osquerybeat that writes
error.messageitself keeps working.This is a breaking change: queries, visualizations and rules that use
errororerror.keywordon this data stream must move toerror.message. The Kibana osquery plugin readserror.keywordtodecide per-agent success or failure, so this package must require a
Kibana version that reads
error.message.Background
The
*.sectionspart of the linked issues was fixed in #16650 and #18989(
resultdata stream). #16650 also described renamingerrortoerror.messageinaction_responses, but that change is not in its diff:on
main,erroris stilltextand the pipeline has no rename. This PRdoes that remaining part.
What changes for data
error: "no such table: foo"(text+error.keyword)error.message: "no such table: foo"(ECS,match_only_text)errorOnly
logs-osquery_manager.action.responses-*changes. Theresultdatastream,
.fleet-actions-results(written by Fleet Server) and theKibana-managed
.logs-osquery_manager.action.responsesindex are nottouched by this package.
Downstream impact
Kibana must ship first
The osquery plugin reads the old field shape in four places:
x-pack/platform/plugins/shared/osquery/server/search_strategy/osquery/factory/actions/results/query.action_results.dsl.ts:167doc['error.keyword']→success/errorcounts per live queryerror.keywordmapping, so the script throws and those shards fail. Counts become wrong or the request errors.x-pack/platform/plugins/shared/osquery/server/lib/get_result_counts_for_actions.ts:123x-pack/platform/plugins/shared/osquery/public/action_results/transform_status_results.ts:37,65fields['error.keyword'], error text fromfields.errorx-pack/platform/plugins/shared/osquery/public/action_results/enrich_edges.ts:21fields.erroris presentquery.scheduled_action_results.dsl.tsalready usesexists: { field: 'error' }.existson an object field matches any subfield, so it should work for bothshapes (not tested here).
The Kibana fix is elastic/kibana#307730 (must land and release first):
filtersaggregation onexists: error(same as the scheduled query). This works on old indices(
errortext) and new ones (error.message), and on.fleet-actions-results, which Kibana falls back to. Checked onElasticsearch 9.2 with both mappings searched together.
error.message, falling back toerror,and derives the status from that, not from
error.keyword.error.message: ECS maps it asmatch_only_text, which has none.Kibana has to read both shapes for good, not only during upgrade. Old
backing indices keep the
textmapping until they are deleted, and thedefault
logsILM policy has no delete phase.Other internal products
actions, investigation guides, alert flyout) render results through the
osquery plugin. They get the fix for free once the plugin reads both
shapes, and show the same wrong "success" status if they don't.
today, and leaves an
errorobject alone. Writingerror.messageat thesource is optional follow-up work for the beats issue.
.fleet-actions-resultskeeps its ownerrorfield. The Kibana transform that copies it into
.logs-osquery_manager.action.responsesis not affected..logs-endpoint.action.responses,a different index. Not affected.
Customer impact
dashboards, alerting rules, watches, transforms and ES|QL queries that use
errororerror.keywordonlogs-osquery_manager.action.responses-*stop matching new documents. They must switch to
error.message(and useexistsinstead of akeywordterm match).backing indices map
errorastextand new ones as an object. Data viewsover this data stream show
erroras a conflict until the old indices aredeleted. This replaces today's conflict across data streams with one that
ages out.
text→ object is not a compatible mapping change, so Fleet rolls the datastream over; new documents land in the new mapping. No reindex is needed.
so the pipeline handles every agent the same way.
conditions.kibana.versionbump stops this packagefrom being installed on a Kibana that cannot read
error.message.Without it, Kibana would show failed queries as successful.
before the Kibana change is deployed.
Checklist
changelog.ymlfile.Author's Checklist
conditions.kibana.versionraised to that releaseHow to test this PR locally
Related issues
🤖 Generated with Claude Code