Skip to content

[cisco_aironet] Parse strict ARP and NTP rejection variants - #20923

Open
ie-ops wants to merge 6 commits into
mainfrom
fix/0-narrow-the-if-condition-on-processor-57606656
Open

[cisco_aironet] Parse strict ARP and NTP rejection variants#20923
ie-ops wants to merge 6 commits into
mainfrom
fix/0-narrow-the-if-condition-on-processor-57606656

Conversation

@ie-ops

@ie-ops ie-ops commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Executive summary

Expand strict Cisco Aironet parsing for ARP orphan and NTP packet rejection messages without routing on brittle message substrings.

The parser remains gated by Cisco reason values and keeps ignore_failure: false. Supported reason/payload combinations are encoded directly in anchored grok patterns, so unsupported payloads and mismatched reason/payload families continue to reach the pipeline-level failure handler.

Root cause

LOG-4-Q_IND is a shared reason used for multiple payload families. The existing strict grok only understood the ARP orphan format, so a valid NTP rejection event failed ingestion. An intermediate implementation added only the exact Spurious.NTP form and extracted SNTP source fields from every LOG-4-Q_IND, which remained too narrow and mislabeled ARP events.

Implementation

  • Keep strict parsing enabled with ignore_failure: false.
  • Keep processor routing reason-based; do not use message.contains(...).
  • Couple each supported reason to its payload family in the grok patterns:
    • DTL-4-ARP_ORPHANPKT_DETECTED and LOG-4-Q_IND can parse ARP orphan payloads.
    • LOG-4-Q_IND and canonical SNTP-4-PKT_REJECTED can parse NTP rejection payloads.
  • Parse from the preserved full Cisco message so reason and payload are validated together.
  • Support ARP repeated-message suffixes.
  • Support NTP rejection variants with:
    • qualifier plus period, such as Spurious.NTP;
    • qualifier plus whitespace, such as incomprehensible NTP;
    • bare NTP packet rejected;
    • nonnegative socket IDs;
    • optional terminal periods;
    • optional [...It occurred N times.!] suffixes.
  • Populate cisco.sntp.source_file, cisco.sntp.source_line, and cisco.sntp.socket_id only for matching NTP rejection events.
  • Correct the changelog link and update the field documentation.

Test coverage

Added sanitized pipeline fixtures covering:

  • ARP under both supported reasons, with and without the repeated-message suffix.
  • Spurious.NTP, arbitrary qualifier-dot, qualifier-space, and bare NTP forms.
  • LOG-4-Q_IND and canonical SNTP-4-PKT_REJECTED reasons.
  • Terminal-period and repeated-message variants.

All *-expected.json changes were generated with the pipeline test runner. Additional temporary mismatch cases confirmed that a DTL reason with an NTP payload and an SNTP reason with an ARP payload both produce event.kind: pipeline_error; those cases are not committed because the pipeline test runner intentionally rejects documents containing pipeline errors.

Validation

  • elastic-package format --fail-fast
  • elastic-package lint
  • elastic-package check
  • elastic-package test pipeline --data-streams log --generate
  • elastic-package test pipeline --data-streams log

All validation passes on Elastic Stack 9.4.4.

References

  • Cisco Wireless LAN Controller System Message Guide: DTL and EAP system messages
  • Cisco Wireless LAN Controller System Message Guide: SNTP system messages
  • Cisco NTP troubleshooting documentation

@ie-ops ie-ops added enhancement New feature or request Integration:cisco_aironet Cisco Aironet (Community supported) source:integration_sentinel The PR was created via the Integration Sentinel pipeline Team:Integration-Experience Security Integrations Integration Experience [elastic/integration-experience] labels Aug 26, 2026
@github-actions

Copy link
Copy Markdown
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.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@Niceplace
Niceplace marked this pull request as ready for review August 26, 2026 20:20
@Niceplace
Niceplace requested a review from a team as a code owner August 26, 2026 20:20
Copilot AI lite review requested due to automatic review settings August 26, 2026 20:20
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/integration-experience (Team:Integration-Experience)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Cisco Aironet log ingest pipeline to handle LOG-4-Q_IND messages more safely by adding SNTP parsing support, adding new SNTP-related fields, and extending pipeline fixtures to cover the new subtype.

Changes:

  • Add grok extraction for SNTP “Spurious.NTP packet rejected…” LOG-4-Q_IND messages, including socket id and source file/line.
  • Add cisco.sntp.* fields to the integration’s field definitions and documentation.
  • Extend pipeline test fixtures with a sanitized SNTP example and expected output.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/cisco_aironet/manifest.yml Bumps package version to 1.21.2.
packages/cisco_aironet/docs/README.md Documents new cisco.sntp.* fields.
packages/cisco_aironet/data_stream/log/fields/aironet-fields.yml Adds mappings for new cisco.sntp.* fields.
packages/cisco_aironet/data_stream/log/elasticsearch/ingest_pipeline/default.yml Adds SNTP source-context grok and extends Q_IND grok patterns.
packages/cisco_aironet/data_stream/log/_dev/test/pipeline/test-aironet-messages.log Adds an SNTP LOG-4-Q_IND fixture line.
packages/cisco_aironet/data_stream/log/_dev/test/pipeline/test-aironet-messages.log-expected.json Adds expected output for SNTP fixture; also includes new fields on an existing Q_IND fixture.
packages/cisco_aironet/changelog.yml Adds 1.21.2 changelog entry.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 272 to 278
if: >-
ctx._temp_?.reason == 'DTL-4-ARP_ORPHANPKT_DETECTED' ||
ctx._temp_?.reason == 'LOG-4-Q_IND'
patterns:
- "STA\\(Target MAC Address\\) \\[%{MAC:client.mac}.*?\\] %{DATA:event.reason}\\(Source IP Address\\) %{IP:client.ip}%{DATA}\\(Destination IP Address\\) %{IP:server.ip}"
- "Spurious\\.NTP packet rejected on socket %{INT:cisco.sntp.socket_id:int}"
ignore_failure: false
Comment thread packages/cisco_aironet/docs/README.md Outdated
Comment on lines +318 to +320
| cisco.sntp.socket_id | Socket identifier on which a spurious SNTP/NTP packet was rejected | integer |
| cisco.sntp.source_file | C source filename that generated the SNTP log entry | keyword |
| cisco.sntp.source_line | Line number in the C source file that generated the SNTP log entry | integer |
Comment on lines +70 to +78
- name: cisco.sntp.socket_id
type: integer
description: Socket identifier on which a spurious SNTP/NTP packet was rejected
- name: cisco.sntp.source_file
type: keyword
description: C source filename that generated the SNTP log entry
- name: cisco.sntp.source_line
type: integer
description: Line number in the C source file that generated the SNTP log entry
Comment thread packages/cisco_aironet/changelog.yml Outdated
Comment on lines +2 to +6
- version: "1.21.2"
changes:
- description: Fix LOG-4-Q_IND grok processor to only match ARP subtype messages, preventing pipeline errors for non-ARP subtypes such as SNTP.
type: bugfix
link: https://github.com/elastic/integrations/pull/1
tag: grok_sntp_source_context_a3f7c891
description: LOG-4-Q_IND SNTP - extract source file and line from full_message before the field is stripped
field: _temp_.full_message
if: "ctx._temp_?.reason == 'LOG-4-Q_IND'"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: 🟡 Medium confidence: high path: packages/cisco_aironet/data_stream/log/elasticsearch/ingest_pipeline/default.yml:264

The new SNTP source-context grok fires on every LOG-4-Q_IND, so the pre-existing ARP-orphan event is mislabeled with cisco.sntp.* fields; gate the if on the SNTP message text.

Details

LOG-4-Q_IND is shared by two unrelated subtypes: the ARP-orphan message (...%LOG-4-Q_IND: [PA]dtl_net.c:3393 STA(Target MAC Address) ... ARP ..., test log line 1) and the SNTP spurious-packet message this PR adds. The new grok_sntp_source_context_a3f7c891 processor gates only on ctx._temp_?.reason == 'LOG-4-Q_IND', so it also matches the ARP event and writes cisco.sntp.source_file/cisco.sntp.source_line onto it. This is visible in the updated expected JSON, where the ARP event (@​timestamp 2026-09-06T23:08:09.371+08:00, client.ip 169.254.161.111) now carries cisco.sntp.source_file: "[PA]dtl_net.c" and cisco.sntp.source_line: 3393. Those fields are documented as 'the SNTP log entry' source, so tagging a DTL/ARP event with them is an incorrect field mapping.

Recommendation:

Restrict the extraction to the actual SNTP subtype by adding a message-content guard so ARP-orphan events are not tagged with cisco.sntp.*.

Suggested change
if: "ctx._temp_?.reason == 'LOG-4-Q_IND'"
if: "ctx._temp_?.reason == 'LOG-4-Q_IND' && ctx.message != null && ctx.message.contains('Spurious.NTP packet rejected')"

🤖 AI-Generated Review | Vera Review Bot - v0.2.7 | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

Comment thread packages/cisco_aironet/changelog.yml Outdated
changes:
- description: Fix LOG-4-Q_IND grok processor to only match ARP subtype messages, preventing pipeline errors for non-ARP subtypes such as SNTP.
type: bugfix
link: https://github.com/elastic/integrations/pull/1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: 🟡 Medium confidence: high path: packages/cisco_aironet/changelog.yml:6

Changelog links a different PR number

Details

This changelog entry's link: points at pull/1, but it was added in PR #​20923. It is likely a leftover template placeholder or a copy from another PR.

Recommendation:

Point each added changelog entry's link at this PR:

link: https://github.com/elastic/integrations/pull/20923

🤖 AI-Generated Review | Vera Review Bot - v0.2.7 | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@Niceplace Niceplace self-assigned this Aug 27, 2026
@Niceplace Niceplace changed the title [cisco_aironet] Fix LOG-4-Q_IND grok to match ARP subtype only. [cisco_aironet] Parse strict ARP and NTP rejection variants Aug 27, 2026
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@vera-review-bot

Copy link
Copy Markdown

🟢 No issues across the latest commits b543140.

Review summary

Issues found across earlier commits b090d75 — 2 medium
  • 🟡 The new SNTP source-context grok fires on every LOG-4-Q_IND, so the pre-existing ARP-orphan event is mislabeled with cisco.sntp.* fields (link) (Unresolved)
  • 🟡 Changelog links a different PR number (link) (Unresolved)

A new commit triggers another review — at most once every 15 minutes. I skip the PR while it's approved or has merge conflicts.

🤖 AI-Generated Review | Vera Review Bot - v0.2.7 | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @Niceplace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Integration:cisco_aironet Cisco Aironet (Community supported) source:integration_sentinel The PR was created via the Integration Sentinel pipeline Team:Integration-Experience Security Integrations Integration Experience [elastic/integration-experience]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants