{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":30233,"path":"it-operations-management/event-management/alert-correlation-rule-form.md","title":"Alert correlation rule form","bundle":null,"doc_type":null,"release":"australia","body":"\n# Alert correlation rule form\n\nManage the fields that define how alerts are correlated and grouped.\n\n<table id=\"table_v22_jmg_s5\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nName of the correlation rule.\n\n</td></tr><tr><td>\n\nOrder\n\n</td><td>\n\nThe evaluation priority for the rule. Rules with lower numerical values are given higher priority. An alert is evaluated against each alert action rule until a match is found.For example, if you have two alert correlation rules with priorities 10 and 20, respectively, the rule with priority 10 will be evaluated first. If an alert matches the criteria of the rule with priority 10, no further rules will be checked. If it doesn’t match, the alert will then be evaluated against the rule with priority 20.\n\n</td></tr><tr><td>\n\nActive\n\n</td><td>\n\nOption to activate or deactivate the rule.\n\n</td></tr><tr><td>\n\nAdvanced\n\n</td><td>\n\nOption to switch to advanced mode, which lets you use custom scripts to define your own logic. The sample correlation rule, **Alert correlation rule SAMPLE**, is provided out-of-the-box for reference. You can use the available script as a guide.**Note:** The **Filter** condition specifies which alerts the rule will apply to. Ensure that the same condition is used in the advanced script to identify alerts to be included in the group.\n\n</td></tr><tr><td>\n\nDescription\n\n</td><td>\n\nDescription of the rule.\n\n</td></tr><tr><td>\n\nPrimary Alert\n\n</td><td>\n\nThe filter condition to identify the alert that is the primary alert, or most important alert, in a set of related alerts. This field does not appear when **Advanced** is selected.\n\n</td></tr><tr><td>\n\nSecondary Alert\n\n</td><td>\n\nThe filter condition to identify the alert that is related to the primary alert, however it is of lesser importance.This field does not appear when **Advanced** is selected.\n\n</td></tr><tr><td>\n\nFilter\n\n</td><td>\n\nThe filter condition to identify the alert on which the script is run. **Filter** is available only when **Advanced** is selected.\n\n Filter parameters are case sensitive by default. To disable case sensitivity, set the **sa\\_analytics.correlation\\_case\\_sensitive** parameter to **false**.\n\n</td></tr><tr><td>\n\nRelationship Type\n\n</td><td>\n\nSpecify the type of relationship between the primary and secondary alert:-   **No Relationship**: Ignore the relationship when looking for a match.\n-   **Same CI or Node**: Relate both alerts with the same CI. If the CI field is blank, the alerts must have the same Node value.\n-   **Primary is Parent**: Relate the alerts where the primary alert is the parent in a parent-child relationship, as described in the CI Relationship Types table \\[cmdb\\_rel\\_ci\\].\n-   **Primary is Child**: Relate the alerts where the primary alert is the child in a child-parent relationship, as described in the CI Relationships table \\[cmdb\\_rel\\_ci\\].\n\n This field does not appear when the **Advanced** check box is selected.\n\n</td></tr><tr><td>\n\nTime Difference in Minutes\n\n</td><td>\n\nThe minutes between which the primary and secondary event must occur to match this rule. The default value is 60 minutes.**Note:** The value for this entry cannot exceed 1440 minutes \\(one day\\).\n\n This field does not appear when **Advanced** is selected.\n\n</td></tr><tr><td>\n\nScript\n\n</td><td>\n\nCustom script that you can modify to return a JSON string that specifies the primary and secondary alerts. Select **Advanced** to display the script field.\n\n ```\n\n(/* The function needs to return a JSON- {correlationType:[correlatedAlerts]}\n for example: if your filter matches the alert, set the alert as the primary alert and set alerts 1, 2 and 3 each as secondary alerts.\n \n You can use both multiple primary alerts and multiple secondary alerts.\n The correlationType can be PRIMARY or SECONDARY, and the alerts ID must be in an array. \n CurrentAlert is the GlideRecord of the currentAlert on which that rule runs.  \n The system supports only one primary per alert, so: \n   Do not correlate more than one alert under the PRIMARY array. \n   Do not correlate alerts that already have a primary under the SECONDARY array. \n  The system supports open alerts only, so do not correlate alerts that have been closed under either one of the arrays. \n  */\n \n (function findCorrelatedAlerts(currentAlert){\n \n       var result = {};   //Insert your code here\n       result = {'SECONDARY':['alertID1','alertID2','alertID3']};         \n       return JSON.stringify(result);  \n \n })(currentAlert);\n\n```\n\n</td></tr><tr><td>\n\nRelationship\n\n</td><td>\n\nDescription of the CI relationship between primary and secondary, for example, *Allocated from::Allocated to* or *Allocated to::Allocated from*. This field displays only if either **Primary is Parent** or **Primary is Child** is selected for the **Relationship Type**.\n\n \\[Omitted image \"alert-relationship-type.png\"\\] Alt text: Relationship\n\nThis field does not appear when **Advanced** is selected.\n\n</td></tr></tbody>\n</table>**Parent Topic:**[Event Management reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/event-management/event-management-reference.md)\n\n"}}