[qnap_nas] Add RFC 5424 QuLog@Access syslog format support. - #20902
Closed
ie-ops wants to merge 2 commits into
Closed
[qnap_nas] Add RFC 5424 QuLog@Access syslog format support.#20902ie-ops wants to merge 2 commits into
ie-ops wants to merge 2 commits into
Conversation
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. |
vinit-chauhan
deleted the
fix/b57b0e02f567c44d-add-an-rfc-5424-grok-pattern-16648704
branch
August 25, 2026 21:03
Contributor
|
✅ All changelog entries have the correct PR link. |
Contributor
🚀 Benchmarks reportTo see the full report comment with |
💚 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.
Executive summary
The ingest pipeline for qnap_nas.log was failing with MISSING_CASE errors because QTS 5.x devices emit logs in RFC 5424 format (ISO 8601 timestamps, structured-data blocks) while the existing grok processor only covered the legacy BSD syslog format. This fix adds a new grok pattern for RFC 5424 messages before the existing BSD pattern, a kv processor plus supplementary grok steps to extract QuLog@Access structured-data key-value pairs (including multi-word quoted values like client_app and client_agent), rename processors to map parsed fields to ECS, a painless script to translate numeric action codes to event.action vocabulary, and new ECS and custom field declarations for source.mac, user_agent.original, qnap.nas.client_app, qnap.nas.client_id, and qnap.nas.action_code.
Proposed commit message
Root cause
The grok_event_original_cad2ef7a processor contains only an RFC 3164 pattern using SYSLOGTIMESTAMP (MMM dd HH:mm:ss), but QTS 5.x devices emit RFC 5424 syslog with a version byte '1', an ISO 8601 timestamp, and a structured-data block [QuLog@Access key="val" ...] whose format never matches the existing pattern, causing every QTS 5.x event to reach the on_failure handler with pipeline_error.
Approach
Add an RFC 5424 grok pattern as the first alternative in grok_event_original_cad2ef7a to match '1 qulogd:? - [QuLog@Access ] ', then add a kv processor to parse the structured-data key-value pairs into _tmp.sd.* fields, followed by rename/set processors mapping ip→source.address, user→user.name, mac→source.mac, client_agent→user_agent.original. Add ISO8601 to the existing date processor formats, condition the second grok on RFC 3164 path only (if: _tmp.structured_data == null), and add a Painless script to map numeric action codes (512→login) combined with action_result=0→success into the existing event.action/event.outcome vocabulary consumed by the ECS categorization script.
Implementation
Pipeline changes
Field / mapping changes
Sanitized error message
Processor 'grok' with tag 'grok_event_original_cad2ef7a' in pipeline 'logs-qnap_nas.log-default' failed with message '[on_failure_message]'Sanitized log (
event_sanitizedexcerpt)<30>1 2026-06-28T19:39:06.466+01:00 host-example qulogd: 19683 - [QuLog@Access mac="00-00-5E-00-53-23" ip="192.0.2.10" user="alice.johnson" source="example-source" computer="---" application="---" action="512" action_result="0" service="1024" extra_data="" client_id="89a1d5c1-2b3e-4f67-8a9b-0c1d2e3f4a5b" client_app="Web Desktop" client_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36 Edg/149.0.0.0"] AdministrationReviewer concerns
client_app="Web Desktop"andclient_agent="Mozilla/5.0 …". The fix handles this with dedicated grok processors that run after kv and overwrite the truncated kv values. This is correct for the known fields but could silently drop or truncate any future QuLog@Access keys whose values contain spaces unless a corresponding grok override is added.sourcekey in QuLog@Access structured data (e.g.,source="example-source") is extracted by kv but never renamed to a target field and is silently discarded. It is unclear what this field represents; a comment or intentional ignore would clarify intent.Self-review findings
Self-review invoked: yes (1 cycle)
Final validation passed: yes
Risk and classification
Links
b57b0e02f567c44d