[infoblox_nios] Fix NIOS 9 named log parsing - #21004
Conversation
NIOS 9 prefixes named log lines with a logging-category token (e.g. `queries:`, `security:`). The notify, zone-transfer, and DNSSEC-validation grok patterns lacked that prefix, silently dropping dns.question.* fields. A trailing EDNS Client Subnet suffix on `queries` lines also blocked any match. Fix both by accepting the optional category prefix on all affected patterns and adding an ECS_CLIENT_SUBNET pattern definition for the suffix. Normalise dns.question.name to lowercase after extraction (DNS is case-insensitive; BIND may 0x20-encode names). Parse the message tail for query-errors, security, xfer-in, and notify categories to extract failure_reason, action, query_context, and transfer status. Derive ECS event.outcome and dns.response_code from those values; raw BIND tokens stay in infoblox_nios.log.dns.*.
✅ 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. |
🚀 Benchmarks reportTo see the full report comment with |
|
Pinging @elastic/integration-experience (Team:Integration-Experience) |
There was a problem hiding this comment.
🟡 Changes recommended
It includes unrelated DHCP expected-fixture changes (including future-dated timestamps) that should be justified in the PR scope/description or addressed to avoid noisy, potentially confusing test updates.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the infoblox_nios integration’s DNS ingest pipeline to correctly parse Infoblox NIOS 9 named logs that now include a logging-category prefix (e.g. queries:, security:), restoring dns.question.* extraction and enriching events with additional DNS outcome/context fields.
Changes:
- Extend DNS grok patterns to accept an optional category prefix and handle EDNS Client Subnet (
[ECS ...]) suffixes onquerieslines. - Add parsing for
query-errors,security,xfer-in, andnotifymessage tails to populate new fields and deriveevent.outcomeand (allow-listed)dns.response_code. - Update package version/changelog, field definitions, docs, and pipeline tests to cover the new NIOS 9 shapes.
File summaries
| File | Description |
|---|---|
| packages/infoblox_nios/manifest.yml | Bumps package version to 2.2.0. |
| packages/infoblox_nios/docs/README.md | Documents newly parsed DNS fields. |
| packages/infoblox_nios/data_stream/log/fields/fields.yml | Adds field definitions for new DNS enrichment fields. |
| packages/infoblox_nios/data_stream/log/elasticsearch/ingest_pipeline/pipeline_dns.yml | Updates grok patterns and adds enrichment/derivation steps for NIOS 9 DNS logs. |
| packages/infoblox_nios/data_stream/log/_dev/test/pipeline/test-dns.log-expected.json | Updates expected output to validate new parsing/enrichment. |
| packages/infoblox_nios/data_stream/log/_dev/test/pipeline/test-dns.log | Adds representative NIOS 9 named log samples across categories. |
| packages/infoblox_nios/data_stream/log/_dev/test/pipeline/test-dhcp.log-expected.json | Updates DHCP expected fixture timestamps (year changes across the file). |
| packages/infoblox_nios/changelog.yml | Adds 2.2.0 changelog entries for the DNS parsing fix and enhancements. |
Review details
- Files reviewed: 7/8 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
🟢 No issues across the latest commits a3d9e52.
🤖 AI-Generated Review | Vera Review Bot - v0.3.0 | 📚 Knowledge base: integration-skills
|
ilyannn
left a comment
There was a problem hiding this comment.
Note: This review has been drafted with 🤖 Cursor/Claude Opus 5 under my supervision.
I checked the premise and the regression risk against a real cluster rather than off the grok, by running every fixture line through the published 2.1.2 pipeline and diffing the result against this PR's expectation file.
The premise holds. All 15 new lines extract none of dns.question.name, type or class on 2.1.2 — the bug reproduces for every category touched here (queries with an ECS suffix, query-errors, security, xfer-in, notify, dnssec). The 0x20-encoding case works too: Www.eXaMple.cH lands as www.example.ch.
No regressions. Full-field sweep over all 48 fixture lines: nothing lost on the 32 pre-existing ones, and two of them are fixed as a side effect (line 6 query failed, line 13 received notify now contribute the query name to related.hosts). The only fields dropped are infoblox_nios.log.dns.message on the three new ECS queries lines, which is intentional — they now match the structured alternative instead of the %{CLIENT} %{GREEDYDATA} catch-all, so they behave like every other parsed query line.
Nice touches worth keeping: the ecs_client_subnet group description disambiguating ECS-the-option from ECS-the-schema, the RCODE allow-list keeping internal BIND tokens out of dns.response_code, and appending the subnet address to related.ip.
Approving. One substantive comment below on dns.question.class that I'd like you to consider before merge, one on test coverage, and two nits — none of them blocking.
|
Tick the box to add this pull request to the merge queue (same as
|
- Fix dns.question.class greediness on zone/transfer patterns: replace
%{DATA} with %{WORD} and add an optional /%{NOTSPACE:...log.view}
group so multi-view BIND logs (name/class/view:) don't pollute the
ECS dns.question.class field (lines 20, 21, 22, 27 of pipeline_dns).
- Add missing extended DNS RCODEs (BADVERS, BADKEY, BADTIME, BADMODE,
BADNAME, BADALG, BADTRUNC, BADCOOKIE) to the response-code allow-list
and normalise the candidate to uppercase before the list check,
removing the case-sensitivity asymmetry with script_event_outcome_transfer.
- Add test fixtures for the previously untested approved security action
and the bare [ECS] form (no subnet address).
- Replace 'may' with 'can' in the failure_reason field description
(Vale Elastic.WordChoice).
There was a problem hiding this comment.
🟢 Approval recommended
The pipeline, fields, docs, and fixtures are updated consistently to cover the NIOS 9 parsing changes and derived ECS fields without any confirmed defects in the reviewed diffs.
Review details
- Files reviewed: 7/8 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
✅ All changelog entries have the correct PR link. |
💚 Build Succeeded
History
|
|
@ilyannn - I've addressed your comments in the last commit. Could you please give it another look? |
|
Re-reviewed at cde80f7 — thanks, this addresses everything. Nice call applying the class fix to all four zone/transfer patterns rather than just the new one. Verified the result: the expected-output file adds 283 lines with zero deletions, so none of the 48 pre-existing documents changed — the One side effect I hadn't expected: bounding the class to Two small things before you queue it, neither needing another round from me:
Spotted while re-reading, but out of scope here: line 24 ( Approval stands either way. This comment has been drafted with 🤖 Cursor/Claude Opus 5 under my supervision. |
|
One more thing, on the proposed commit message rather than the code — since that block becomes the squash commit, it's worth getting right. "A trailing EDNS Client Subnet suffix on The suffix blocked the structured query alternative, so the line fell through to the Two smaller things in the same block: it predates cde80f7, so it doesn't mention the Suggested replacement: Also cosmetic: the Author's Checklist says the fixtures cover "all four categories" — it's six now ( For what it's worth I checked the linked issues too, and both This comment has been drafted with 🤖 Cursor/Claude Opus 5 under my supervision. |
|
Package infoblox_nios - 2.2.0 containing this change is available at https://epr.elastic.co/package/infoblox_nios/2.2.0/ |
Proposed commit message
Checklist
changelog.ymlfile.Author's Checklist
test-dns.logandtest-dns.log-expected.json) to cover new NIOS 9 log lines for all four categoriesfields/fields.ymlanddocs/README.mdevent.outcomeanddns.response_codeare only set when there is enough information; DNS-specific RCODE strings are allow-listed to prevent internal BIND status tokens from leaking intodns.response_codeHow to test this PR locally
The
test-dns.logfile contains representative NIOS 9 lines for each new category. Compare the rendered output againsttest-dns.log-expected.json.To smoke-test against a real stack:
queries,query-errors,security,xfer-in, andnotifycategories in the BIND logging configuration.dns.question.*,event.outcome, anddns.response_codeare populated correctly.Related issues
Screenshots