[elasticsearch] Decode querylog NDJSON on the Agent - #20986
Open
consulthys wants to merge 1 commit into
Open
Conversation
The x-pack destination template wins over the Fleet ingest pipeline, so querylog lines must be expanded on the shipper. Co-authored-by: Cursor <cursoragent@cursor.com>
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. |
Contributor
|
✅ All changelog entries have the correct PR link. |
|
Not really my place but raising the possibility that the integration pipeline might be more preferable? This would couple it to stack version and effectively make the existing pipeline for querylog in the integration (which does exist), meaningless? |
💚 Build Succeeded
|
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.
Proposed commit message
Query log files are already ECS JSON. Filebeat expands them with
filestream+ndjson. The integration Agent stream was a plainlogfileinput, so parsing depended onpipeline-json.ymlvia the Fleetdefault_pipeline. That template (priority 200) loses to x-packlogs-elasticsearch.querylog@template(priority 240 after elastic/elasticsearch#158188). Events stayed as a JSON string inmessageand the dashboard was empty.This expands NDJSON on the Agent (
decode_json_fields+expand_keys), matching Filebeat. The ingest pipeline stays as a fallback for rawmessagelines (pipeline tests still cover that).Checklist
changelog.ymlfile.How to test this PR locally
On a 9.4+ cluster with
elasticsearch.querylog.enabled: trueand this package installed, documents inlogs-elasticsearch.querylog-*should haveelasticsearch.querylog.typepopulated even whenlogs-elasticsearch.querylog@templateis the matching index template.Related issues