fix(suricata-fastlogs): use Priority field instead of GID for suricata_rule_severity#1782
Open
fix(suricata-fastlogs): use Priority field instead of GID for suricata_rule_severity#1782
Conversation
Agent-Logs-Url: https://github.com/crowdsecurity/hub/sessions/a23b50a7-3796-4d0b-8c72-1de02a7e5972 Co-authored-by: buixor <990714+buixor@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix suricata-fastlogs parser to extract Priority field correctly
fix(suricata-fastlogs): use Priority field instead of GID for suricata_rule_severity
Apr 28, 2026
buixor
approved these changes
Apr 28, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Suricata fast.log severity mapping by using the alert Priority value (from [Priority: N]) instead of the rule GID (from [GID:SID:REV]), preventing scenarios like crowdsecurity/suricata-major-severity from matching every alert due to GID being 1 for standard rules.
Changes:
- Update the
SURICATA_RULE_IDgrok capture to parsesuricata_gid(correctly labeling the GID portion of[GID:SID:REV]). - Map
suricata_rule_severitymeta fromevt.Parsed.suricata_priority(the actual Priority field) instead of the former GID-derived value. - Adjust fast.log parser tests to assert
suricata_gidand the correctedsuricata_rule_severitymeta values.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| parsers/s01-parse/crowdsecurity/suricata-logs.yaml | Corrects severity meta sourcing for fast.log by using parsed Priority and renames the GID capture. |
| .tests/suricata-logs-fastlog/parser.assert | Updates assertions to reflect the new parsed field name (suricata_gid) and expected meta severity values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
The
suricata-fastlogsparser was mapping the Generator ID (GID) from[GID:SID:REV]tosuricata_rule_severitymeta. Since GID is always1for standard Suricata rules,crowdsecurity/suricata-major-severitymatched every alert regardless of actual priority, causing false positive bans.Changes
parsers/s01-parse/crowdsecurity/suricata-logs.yamlSURICATA_RULE_IDfromsuricata_rule_severity→suricata_gid(the field is the GID, not severity)suricata_rule_severitystatic to source fromevt.Parsed.suricata_priority(the[Priority: N]field) instead of the GID capture.tests/suricata-logs-fastlog/parser.assertsuricata_gidparsed fieldsuricata_rule_severitymeta expectations to reflect actual Priority values (3,2,2,1across the four test log entries)This aligns the fast.log parser with the eve.log parser, which correctly uses
JsonExtract(evt.Parsed.message, "alert.severity").Checklist