Location-Based Alert Correlation Rule Not Working as Expected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
We are attempting to correlate alerts generated from the same location based on the Configuration Item (CI) within a 15-minutes timeframe. We have implemented the approach below, but it is not working as expected.
• We created an Alert Correlation Rule using an Advanced Script (script attached).
• The objective is to correlate network device alerts originating from the same location within a 15-minute window.
• The earliest alert should be designated as the Primary Alert, while subsequent alerts should be marked as Secondary Alerts.
• Additionally, the 'Classification' field of secondary alerts should be updated to "Security".
Note: As of now for other correlation rules, both primary and secondary alerts are creating incidents. Our requirement is to have only a single incident created for the location based correlation. To identify such secondary alerts and prevent incident creation, we are attempting to update their Classification field to "Security", so that we can filter this in alert management rule.
Could you please review the approach and advise why the correlation rule is not working? Is there a better way to handle this scenario?
Filter condition used in the alert correlation rule: sourceSTARTSWITHSolarWinds^descriptionLIKECreateINC#<True>#^cmdb_ciISNOTEMPTY^EQ
Order Number: 90(Other correlation rule has order number 100)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Durgaprasad,
Start with the filter, because as pasted it cannot match any alert, which means the advanced script never runs at all:
sourceSTARTSWITHSolarWinds^descriptionLIKECreateINC#<True>#^cmdb_ciISNOTEMPTY^EQ
The description condition is asking for the literal text "CreateINC#<True>#" in the alert description. No SolarWinds alert contains that, so the rule evaluates zero alerts. Prove it before changing anything: paste that encoded query into an em_alert list and you will get 0 rows. Remove the "#<True>#" artifact so the condition is simply description LIKE CreateINC, and the same list query returns the alerts you expect. A correlation rule only ever evaluates alerts that pass its filter.
Once the filter matches, verify the script against the advanced correlation contract:
1. The script is evaluated for the incoming alert, and it must return the sys_id of the alert that should become the Primary. Returning true/false, or returning the current alert, groups nothing - the incoming alert becomes a secondary of whichever alert's sys_id the script returns, so the script has to query for an earlier alert and return that record's sys_id.
2. It only runs when an alert is processed. Alerts already sitting in em_alert are not re-evaluated, so test with fresh alerts arriving inside your 15-minute window, not with yesterday's alerts.
3. Your grouping key depends on cmdb_ci.location being populated, and your filter only checks that cmdb_ci is not empty - it does not check the location. SolarWinds-discovered network CIs very often have an empty Location. In the script, explicitly require: candidate alert created within the last 15 minutes, candidate.cmdb_ci.location is not empty, and candidate.cmdb_ci.location = current.cmdb_ci.location. Without the not-empty check, empty-location devices either never group or group together incorrectly.
Your order is not the problem: order 90 runs before order 100, so this rule gets first chance at any alert that passes its filter.
On the Classification idea: treat it as a display aid, not as the mechanism. Correlation groups the alerts first (Primary/Secondary is decided by the grouping itself), so base the Alert Management Rule condition on the alert being a secondary/grouped alert rather than relying on a field stamped by the correlation script - that keeps the "incident only for the Primary" behaviour even if the script's field update does not happen.
Fix the filter first and retest with two fresh alerts from CIs at the same location - in my experience that condition alone explains a rule that appears to do nothing at all.
Regards,
Karimuddin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @kmohammed Thanks for the reply.
Filter conditions should not be based on root cause. Incident creation is controlled through standard tags sent by SolarWinds. All actionable events include either CreateINC#<True># or CreateINC#<False># in the event description. An Alert Management Rule has been configured to create incidents only when the alert contains the tag CreateINC#<True>#.
As of now, incidents are being created for both Primary and Secondary alerts. However, only for location-based correlation, we do not want incidents to be created for Secondary alerts. Only the Primary alert should generate an incident, while Secondary alerts should be correlated without incident creation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Durgaprasad,
Thanks for clarifying — that changes where the fix belongs. You are right that the CreateINC tag is an incident-control tag, not a correlation key. The correlation rule and the incident rule do two different jobs, and the incident suppression has to happen in the Alert Management Rule, not in the correlation rule.
Why you still get incidents for secondary alerts: correlation only groups the alerts — it sets the Primary Alert on the secondary alert. It does not stop the Alert Management Rule from firing. That rule still sees every alert carrying CreateINC#<True>#, primary or secondary, and creates an incident for each one.
The fix is in the Alert Management Rule that creates incidents. Add a condition that the alert is a primary alert: Primary Alert is empty. A secondary alert has Primary Alert populated with the sys_id of its primary alert; the primary alert itself has that field empty. So the incident rule becomes: Description contains CreateINC#<True># AND Primary Alert is empty. Secondary alerts are still correlated into the group, but they no longer create incidents. This also replaces the Classification = Security workaround — Primary Alert is the direct condition, so you do not need to rely on a field being set during correlation.
Two things to check while you are there:
1. If you want every alert from the same location grouped, including the CreateINC#<False># ones, drop the description condition from the correlation rule filter and keep the location/source conditions. The tag check only needs to live in the incident rule.
2. Retest with two fresh alerts from CIs at the same location, and confirm on the secondary alert that Primary Alert is populated. That confirms the grouping happened before the incident rule evaluated it. If a secondary still creates an incident after this change, check the order and the insert/update settings of the incident rule.
Regards,
Karimuddin
If this helped, please mark it as Helpful — and if it solved your issue, I'd be grateful if you accepted it as the solution.