Skip to content

[cisco_meraki] Fix Blocked RA Packet grok pattern in events pipeline. - #20394

Merged
haetamoudi merged 8 commits into
mainfrom
fix/0-add-a-second-grok-pattern-for-75746048
Aug 11, 2026
Merged

[cisco_meraki] Fix Blocked RA Packet grok pattern in events pipeline.#20394
haetamoudi merged 8 commits into
mainfrom
fix/0-add-a-second-grok-pattern-for-75746048

Conversation

@ie-ops

@ie-ops ie-ops commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Executive summary

The cisco_meraki events pipeline only handled 'Blocked ARP Packet' events via Grok, causing parse failures for 'Blocked RA Packet' and 'Blocked DHCP Packet' events which share a similar but distinct log format (IP in parentheses, explicit 'VLAN' keyword). The fix adds two new Grok patterns plus corresponding BLOCKEDRA/BLOCKEDDHCP pattern definitions, and two new set processors to assign the correct event_subtype values (ra_blocked, dhcp_blocked). Test fixtures covering both new event types are included and all pipeline tests pass.

Proposed commit message

[cisco_meraki] Fix Blocked RA Packet grok pattern in events pipeline.

Root cause

The BLOCKEDARP grok pattern definition in events.yml (line 130) hardcodes the literal 'Blocked ARP Packet' and the rest of the pattern uses with IP %{IP:source.ip} syntax, which does not match Cisco Meraki's 'Blocked RA Packet' events where the IPv6 source address is enclosed in parentheses and the message ends with 'by default'. Both the literal string and the IP capture syntax must be extended to handle the RA variant.

Approach

Add a second grok pattern for the RA (Router Advertisement) packet variant to the existing 'Handle Blocked ARP' grok processor in events.yml. The RA format differs structurally from ARP: it wraps the IPv6 address in parentheses and appends 'by default', so a dedicated alternative pattern with %{BLOCKEDRA:_temp.blocked_ra} is needed. A follow-on set processor maps the new temp capture to a distinct ra_blocked event subtype, preserving existing arp_blocked behaviour unchanged. A test fixture is added for the sanitized RA event.

Implementation

  1. Step 1: In packages/cisco_meraki/data_stream/log/elasticsearch/ingest_pipeline/events.yml (lines 121-143), add a second pattern entry to the existing blocked-ARP grok processor that matches the RA format: '^%{SYSLOGHDR}%{SPACE}%{NUMBER}%{SPACE}%{WORDORHOST}%{SPACE}events%{SPACE}(?<message>%{BLOCKEDRA:_temp.blocked_ra} from %{MAC:source.mac} \(%{IP:source.ip}\) on VLAN %{WORD:observer.ingress.vlan.id}(?: by default)?)$'. Add a new BLOCKEDRA: 'Blocked RA Packet' entry to the pattern_definitions block.
  2. Step 2: In the same file, after the existing set event_subtype=arp_blocked processor (line 140-143), add a new set processor: field: cisco_meraki.event_subtype, value: ra_blocked, if: ctx._temp?.blocked_ra != null.
  3. Step 3: In packages/cisco_meraki/data_stream/log/_dev/test/pipeline/test-events.log, append the sanitized RA test event: <134>1 1782557203.245381197 blvl_01 events Blocked RA Packet from 00-00-5E-00-53-23 (2001:db8::1) on VLAN 201 by default.
  4. Step 4: In packages/cisco_meraki/data_stream/log/_dev/test/pipeline/test-events.log-expected.json, append the expected document for the RA event with cisco_meraki.event_subtype: ra_blocked, source.mac: 00-00-5E-00-53-23, source.ip: 2001:db8::1, observer.ingress.vlan.id: 201, message: 'Blocked RA Packet from 00-00-5E-00-53-23 (2001:db8::1) on VLAN 201 by default', log.syslog.priority: 134, and related.ip: ['2001:db8::1'].
  5. Step 5: In packages/cisco_meraki/changelog.yml, prepend a new version: 1.31.2 entry with type: bugfix and description: Fix grok pattern to support Blocked RA Packet events in addition to Blocked ARP Packet events.
  6. Step 6: In packages/cisco_meraki/manifest.yml, update version from 1.31.1 to 1.31.2.
  7. Step 7: Run elastic-package test pipeline for the cisco_meraki log data stream to confirm both ARP and RA test cases pass.

Pipeline changes

  • Add second grok pattern BLOCKEDRA (literal 'Blocked RA Packet') to the existing blocked-ARP grok processor's patterns list; new pattern captures MAC to source.mac, IPv6 (in parens) to source.ip, and VLAN number to observer.ingress.vlan.id — with an optional (?: by default)? terminal group
  • Add BLOCKEDRA: 'Blocked RA Packet' to the grok processor's pattern_definitions block
  • Add new set processor after existing arp_blocked set: field: cisco_meraki.event_subtype, value: ra_blocked, if: ctx._temp?.blocked_ra != null

Field / mapping changes

Sanitized error message

Provided Grok expressions do not match field value: [on_failure_message]

Sanitized log (event_sanitized excerpt)

<134>1 1782557203.245381197 blvl_01 events Blocked RA Packet from 00-00-5E-00-53-23 (2001:db8::1) on VLAN 201 by default

Reviewer concerns

  • The two new patterns share an identical structure; if Cisco Meraki adds further 'Blocked Packet' variants in the future, each will require a separate pattern and set processor. A more generic pattern with a capture group for the packet type would be more maintainable, though the current explicit approach is acceptable and consistent with the existing ARP pattern.
  • The RA/DHCP pattern uses on VLAN %{WORD:observer.ingress.vlan.id} while the ARP pattern uses on %{NOTSPACE} %{GREEDYDATA:observer.ingress.vlan.id} — reviewers should confirm this difference is intentional and reflects a real format difference between ARP and RA/DHCP log lines.
  • The if guard requires cisco_meraki.event_subtype == "blocked" to be set by an upstream processor; the test passing confirms this path works, but reviewers should verify that RA/DHCP blocked events are reliably classified as blocked subtype in the earlier pipeline stage.

Self-review findings

Risk and classification

  • Plan risk level: low
  • Tags: pipeline, processors, ingest, test-fixture
  • Impact: medium

Links

  • Issue: (no issue number)
  • Issue title: cisco_meraki.log [MISSING_CASE]: Provided Grok expressions do not match field value: [on_failure_message]
  • Pipeline case: 17f5589529993a8f

@ie-ops ie-ops added enhancement New feature or request Integration:cisco_meraki Cisco Meraki source:integration_sentinel The PR was created via the Integration Sentinel pipeline Team:Integration-Experience Security Integrations Integration Experience [elastic/integration-experience] labels Jul 29, 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

elastic-vault-github-plugin-prod Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

Package cisco_meraki 👍(0) 💚(0) 💔(2)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
events 333333.33 250000 -83333.33 (-25%) 💔
log 3571.43 2341.92 -1229.51 (-34.43%) 💔

To see the full report comment with /test benchmark fullreport

@haetamoudi
haetamoudi marked this pull request as ready for review July 29, 2026 14:29
@haetamoudi
haetamoudi requested a review from a team as a code owner July 29, 2026 14:29
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

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

Comment thread packages/cisco_meraki/changelog.yml Outdated
Comment thread packages/cisco_meraki/changelog.yml
if: ctx._temp?.blocked_ra != null
- set:
field: cisco_meraki.event_subtype
value: dhcp_blocked

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: 🔵 Low confidence: low path: packages/cisco_meraki/data_stream/log/elasticsearch/ingest_pipeline/events.yml:154

The new dhcp_blocked subtype does not set network.protocol, unlike the other DHCP subtypes in this pipeline (dhcp_offer, dhcp_no_offer, multiple_dhcp_servers_detected), which all set network.protocol: dhcp. Add the same set processor for consistency.

Details

events.yml sets network.protocol: dhcp for dhcp messages (line 77-80) and for multiple_dhcp_servers_detected (line 247-250). The newly added dhcp_blocked subtype describes a blocked DHCP packet but leaves network.protocol unset, so DHCP-scoped queries such as network.protocol: dhcp will not surface these blocked-packet events.

Recommendation:

Add a matching set processor after the dhcp_blocked subtype assignment:

- set:
    field: cisco_meraki.event_subtype
    value: dhcp_blocked
    if: ctx._temp?.blocked_dhcp != null
- set:
    field: network.protocol
    value: dhcp
    if: ctx._temp?.blocked_dhcp != null

Regenerate test-events.log-expected.json afterwards so the two dhcp_blocked fixture events include the new field.


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

⚠️ Automated review — verify suggestions before applying.

Comment thread packages/cisco_meraki/changelog.yml Outdated
@vera-review-bot

Copy link
Copy Markdown

Review summary

Issues found across the latest commits 4e0b0cc — 1 low
  • 🔵 The new eventmap entries give ra_blocked and dhcp_blocked event.type 'denied', but the sibling arp_blocked subtype still has no eventmap entry, so add one so all three blocked-packet events categorize consistently. (link) (Unresolved)
Issues found across earlier commits 2dbf4f1 — 1 low
  • 🔵 The grok processor this PR extends with the RA/DHCP patterns still has no tag, unlike the set processors just below it that were given one. Add a tag (and a description) so a pattern mismatch is attributable in error.message. (link) (Unresolved)
Issues found across earlier commits c234325 — 1 high, 1 low
  • 🟠 Changing event.action for already-supported Blocked ARP Packet events from arp_blocked to arp-packet-blocked is an "event value change", which this repo's publishing guide classifies as breaking. Change this entry to type: breaking-change and bump the package to 2.0.0 instead of the patch bump 1.31.2. (link) (Unresolved)
  • 🔵 The three new set processors for ra_blocked, dhcp_blocked and network.protocol have no tag, so a failure in one of them lands in error.message with no way to tell which processor produced it. Add a tag to each. (link) (Unresolved)
Issues found across earlier commits cd33362 — 1 medium, 1 low
  • 🟡 The changelog only mentions the grok fix, but this PR also changes event.action for already-supported Blocked ARP Packet events from arp_blocked to arp-packet-blocked and adds denied to event.type. Mention that user-visible change so existing queries and rules can be updated. (link) (Unresolved)
  • 🔵 The new dhcp_blocked subtype does not set network.protocol, unlike the other DHCP subtypes in this pipeline (dhcp_offer, dhcp_no_offer, multiple_dhcp_servers_detected), which all set network.protocol: dhcp. Add the same set processor for consistency. (link) (Unresolved)
Issues found across earlier commits d59dbdd — 1 medium, 2 low
  • 🟡 The new ra_blocked and dhcp_blocked subtypes are missing from the eventmap in default.yml, so blocked packets are categorized as event.type: ["info"] with event.action falling back to the raw subtype string. Add eventmap entries so these denial events get event.type: ["denied"] and a hyphenated action. (link) (Unresolved)
  • 🔵 The changelog entry only mentions Blocked RA Packet, but this change also adds parsing and a new dhcp_blocked subtype for Blocked DHCP Packet events. Extend the description to cover both. (link) (Resolved)
  • 🔵 Both new grok patterns end with an optional (?: by default)? group, but every new fixture line includes the " by default" suffix, so the branch without it is never exercised. Add fixture lines without the suffix. (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 | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@ilyannn ilyannn 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.

Fine with some nits, including some that were already found by the review bot

Comment thread packages/cisco_meraki/data_stream/log/elasticsearch/ingest_pipeline/events.yml Outdated
@mergify

mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@haetamoudi
haetamoudi merged commit f4b2dba into elastic:main Aug 11, 2026
9 checks passed
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package cisco_meraki - 1.31.2 containing this change is available at https://epr.elastic.co/package/cisco_meraki/1.31.2/

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_meraki Cisco Meraki 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