[cisco_ise] Fix NOTCOLON grok pattern to exclude spaces. - #20631
Conversation
✅ 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) |
|
🟢 No issues across the latest commits 7d116e8.
🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills
|
taylor-swanson
left a comment
There was a problem hiding this comment.
merge conflicts need to be resolved, otherwise lgtm
|
Tick the box to add this pull request to the merge queue (same as
|
…s-processor-14024704
|
✅ All changelog entries have the correct PR link. |
💚 Build Succeeded
History
|
|
Package cisco_ise - 1.32.13 containing this change is available at https://epr.elastic.co/package/cisco_ise/1.32.13/ |
Executive summary
The fix addresses a null pointer error (
cannot access method/field [normalizeIndex] from a null def reference) in the cisco_ise RADIUS Accounting pipeline. The root cause was that theNOTCOLONgrok pattern ([^:]*?) used to capturecisco_ise.log.log_severity_levelalso matched strings containing spaces, causing RADIUS Accounting KV-format messages (which lack a traditional severity level prefix) to incorrectly match the first grok pattern instead of falling through to the segment-number pattern. A newSEVERITY_LEVELpattern ([^: ]*?) is introduced that excludes both colons and spaces, ensuring only true severity level tokens (e.g.NOTICE,ERROR) match that capture group, while KV-only messages correctly fall through to the segment number pattern.Proposed commit message
Root cause
The
NOTCOLONcustom pattern definition in thegrok_message_detailsprocessor is'[^:]*?', which excludes only colons but permits spaces. When processing CISE_RADIUS_Accounting events whose_tmp.messagebegins with a numeric message-ID sequence (no leading severity token), Pattern 1 still matches by consuming the entire KV prefix up to the first in-band colon (e.g.,RSSI: 32) as the severity level, since the lazy quantifier can stretch across spaces. This misparse corrupts themessagefield content, preventing the downstream KV processor from splitting the log details correctly.Approach
In default.yml, the
grok_message_detailsprocessor definesNOTCOLON: '[^:]*?', which allows spaces. This causes Pattern 1 (^%{NOTCOLON:log_severity_level}%{SPACE}: %{NOTCOLON:event.action}%{SPACE}: %{GREEDYDATA:message}$) to greedily match KV-pair content likeNAS-Port-Type=Wireless - IEEE 802.11, Connect-Info=CONNECT 54.00 Mbps / 802.11ac / RSSIas the severity level when an unqualified RADIUS Accounting event arrives, because the colon inRSSI: 32satisfies the pattern. The fix is to change the pattern definition toNOTCOLON: '[^: ]*?', excluding spaces so severity-level matches are constrained to single-word tokens (NOTICE, WARN, ERROR, etc.), allowing Pattern 2 (NUMBER-based) to correctly match RADIUS Accounting messages. A new pipeline test fixture is added using the sanitized event to verify the fix.Implementation
grok_message_detailsprocessor'spattern_definitionsblock (line 38), changeNOTCOLON: '[^:]*?'toNOTCOLON: '[^: ]*?'to exclude spaces from the character class.<181>Jun 27 20:31:03 host-1.example.local CISE_RADIUS_Accounting 0043327910 2 1 NAS-Port-Type=Wireless - IEEE 802.11, Connect-Info=CONNECT 54.00 Mbps / 802.11ac / RSSI: 32 / Channel: 36, undefined-186=00-00-5E-00-53-01, undefined-187=00-00-5E-00-53-01, undefined-188=00-00-5E-00-53-02, AcsSessionID=host-1.example.local/552176388/39970818, SelectedAccessService=Wired 802.1X Access, RequestLatency=2, Step=11004, Step=11017, Step=15049, Step=15008, Step=22085, Step=11005, NetworkDeviceGroups=Location#All Locations#Decatur, NetworkDeviceGroups=Device Type#All Device Types#WLC, NetworkDeviceGroups=IPSEC#Is IPSEC Device#No, CPMSessionID=89a1d5c1-2b3e-4f67-8a9b-0c1d2e3f4a5b/eNGQyX2TavFi2t9dwQGLemzNIQQNutapUU, StepLatency=1=0\;2=0\;3=0\;4=1\;5=0, TotalAuthenLatency=2, ClientLatency=0, Network Device Profile=Cisco, Location=Location#All Locations#Decatur, Device Type=Device Type#All Device Types#WLC, IPSEC=IPSEC#Is IPSEC Device#No,cisco_ise.log.category.name=CISE_RADIUS_Accounting,cisco_ise.log.message.id=0043327910,cisco_ise.log.segment.total=2,cisco_ise.log.segment.number=1,cisco_ise.log.nas.port.type=Wireless - IEEE 802.11,cisco_ise.log.acs.session.id=host-1.example.local/552176388/39970818,cisco_ise.log.request.latency=2,cisco_ise.log.step=[11004,11017,15049,15008,22085,11005],cisco_ise.log.network.device.groups=[Location#All Locations#Decatur, Device Type#All Device Types#WLC, IPSEC#Is IPSEC Device#No],cisco_ise.log.selected.access.service=Wired 802.1X Access, with NOcisco_ise.log.log_severity_levelorevent.actionfields set (those are only populated from the severity-prefixed message format).type: bugfixand description:Fix NOTCOLON grok pattern in default pipeline to exclude spaces, preventing RADIUS Accounting KV fields from being misidentified as log severity level.versionfrom1.32.6to1.32.7.elastic-package test pipeline --data-streams logfrom packages/cisco_ise to validate all existing and new test cases pass.Pipeline changes
grok_message_detailsprocessor (line 38): change pattern_definitions entryNOTCOLON: '[^:]*?'toNOTCOLON: '[^: ]*?'— excludes space from the character class so that the severity-level capture group cannot span across whitespace-separated KV tokensField / mapping changes
—
Sanitized error message
cannot access method/field [normalizeIndex] from a null def referenceSanitized log (
event_sanitizedexcerpt)<181>Jun 27 20:31:03 host-1.example.local CISE_RADIUS_Accounting 0043327910 2 1 NAS-Port-Type=Wireless - IEEE 802.11, Connect-Info=CONNECT 54.00 Mbps / 802.11ac / RSSI: 32 / Channel: 36, undefined-186=00-00-5E-00-53-01, undefined-187=00-00-5E-00-53-01, undefined-188=00-00-5E-00-53-02, AcsSessionID=host-1.example.local/552176388/39970818, SelectedAccessService=Wired 802.1X Access, RequestLatency=2, Step=11004, Step=11017, Step=15049, Step=15008, Step=22085, Step=11005, NetworkDeviceGroups=Location#All Locations#Decatur, NetworkDeviceGroups=Device Type#All Device Types#WLC, NetworkDeviceGroups=IPSEC#Is IPSEC Device#No, CPMSessionID=89a1d5c1-2b3e-4f67-8a9b-0c1d2e3f4a5b/eNGQyX2TavFi2t9dwQGLemzNIQQNutapUU, StepLatency=1=0\;2=0\;3=0\;4=1\;5=0, TotalAuthenLatency=2, ClientLatency=0, Network Device Profile=Cisco, Location=Location#All Locations#Decatur, Device Type=Device Type#All Device Types#WLC, IPSEC=IPSEC#Is IPSEC Device#No,Reviewer concerns
NOTCOLONpattern is still used forevent.actioncapture in the same pattern line; reviewers should verify that event action values never contain spaces in practice, though this is unchanged behavior.event.category: ["configuration"]; reviewers should confirm this categorization is correct for the added RADIUS Accounting message type.log_severity_levelfield for the new test case (the message has no severity prefix), which is correct but worth verifying explicitly in review.Self-review findings
—
Risk and classification
Links
dde207f6c73c92a9