[cisco_ftd] Add grok pattern for GRE tunnel teardown (302018).#19830
Draft
haetamoudi wants to merge 1 commit into
Draft
[cisco_ftd] Add grok pattern for GRE tunnel teardown (302018).#19830haetamoudi wants to merge 1 commit into
haetamoudi wants to merge 1 commit 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. |
|
Changelog link mismatch — expected
Tip If expected, add the |
💔 Build Failed
Failed CI StepsHistory |
🚀 Benchmarks reportPackage
|
| Data stream | Previous EPS | New EPS | Diff (%) | Result |
|---|---|---|---|---|
log |
860.59 | 722.02 | -138.57 (-16.1%) | 💔 |
To see the full report comment with /test benchmark fullreport
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
Added a new grok pattern to handle GRE tunnel teardown messages (message ID 302018) that lack source ports. The pattern correctly extracts connection ID, interface names, destination IP and port, duration, and byte counts. A corresponding test case validates the pattern successfully parses the message and enriches it with proper ECS fields including geo-IP data. This resolves the [MISSING_CASE] error where this message format had no matching grok pattern.
Proposed commit message
Root cause
The
parse_teardown_messagegrok processor (tagparse_teardown_message) contains seven patterns that all require a source port in the formatfrom interface:ip/port. GRE tunneling messages omit the source port entirely (from interface:ip), causing all patterns to fail. This is a protocol-level difference: GRE is tunnel-based and does not use per-flow port numbers like TCP/UDP/ICMP.Approach
Add a new grok pattern to the
parse_teardown_messageprocessor to handle GRE (Generalized Routing Encapsulation) tunnel protocol teardown messages (message ID 302018). GRE is a layer-3 tunneling protocol without per-flow ports, so its teardown format differs from TCP/UDP/ICMP: source lacks a port number (from interface:ipinstead offrom interface:ip/port). The new pattern will extract connection ID, source/destination interfaces and addresses, duration, and bytes. Add test fixture with the sanitized GRE teardown event to validate the fix.Implementation
packages/cisco_ftd/data_stream/log/elasticsearch/ingest_pipeline/default.ymlat line 1294 (after the 6th pattern, before the ICMP pattern) to match GRE teardown format:^Teardown (?:Probe )?%{NOTSPACE:network.transport} connection %{NOTSPACE:_temp_.cisco.connection_id} from %{NOTCOLON:_temp_.cisco.source_interface}:%{DATA:source.address} to %{NOTCOLON:_temp_.cisco.destination_interface}:%{DATA:destination.address}/%{NUMBER:destination.port:int} duration %{DURATION:_temp_.duration_hms} bytes %{NUMBER:network.bytes}(?:\s+%{NUMBER}\s+%{NUMBER})?packages/cisco_ftd/data_stream/log/_dev/test/pipeline/test-sample.logwith the sanitized GRE teardown event:<190>2026-06-22T05:48:03Z host-1.example.local : %FTD-6-302018: Teardown GRE connection 309288012 from example-network:198.51.100.10 to example-vlan:203.0.113.20/38912 duration 0:02:29 bytes 154 0 8packages/cisco_ftd/data_stream/log/_dev/test/pipeline/test-sample.log-expected.jsonby runningelastic-package test pipelineto validate the new pattern extracts all fields correctly (connection_id, source/destination interface/address/port, duration, bytes).packages/cisco_ftd/changelog.ymlwith abugfixentry: 'Add grok pattern to handle GRE tunnel teardown messages (302018) that lack source port'.packages/cisco_ftd/manifest.ymlversion bump (patch version increment per semantic versioning).Pipeline changes
parse_teardown_messageprocessor to match GRE tunnel protocol teardown messages where source address omits port. Pattern:^Teardown (?:Probe )?%{NOTSPACE:network.transport} connection %{NOTSPACE:_temp_.cisco.connection_id} from %{NOTCOLON:_temp_.cisco.source_interface}:%{DATA:source.address} to %{NOTCOLON:_temp_.cisco.destination_interface}:%{DATA:destination.address}/%{NUMBER:destination.port:int} duration %{DURATION:_temp_.duration_hms} bytes %{NUMBER:network.bytes}(?:\s+%{NUMBER}\s+%{NUMBER})?- Captures GRE-specific format where source lacks port (GRE is tunnel-based), plus optional trailing byte counters.Field / mapping changes
—
Sanitized error message
Processor 'grok' with tag 'parse_teardown_message' in pipeline 'logs-cisco_ftd.log-default' failed with message '[on_failure_message]'Sanitized log (
event_sanitizedexcerpt)<190>2026-06-22T05:48:03Z host-1.example.local : %FTD-6-302018: Teardown GRE connection 309288012 from example-network:198.51.100.10 to example-vlan:203.0.113.20/38912 duration 0:02:29 bytes 154 0 8Reviewer concerns
The new pattern intentionally omits source.port capture since GRE messages don't use ports, which differs from other teardown patterns and may create field inconsistency in queries. The optional trailing bytes pattern
(?:\s+%{NUMBER}\s+%{NUMBER})?discards the final two numeric values (0 8 in the test case) without capturing them—these may represent protocol-level metadata worth preserving.Self-review findings
—
Risk and classification
Links
8ce565325b948149