Configure Situation Similarity
Configure the Situation Similarity servlet to compare Situations by selected alert fields.
By default, the servlet uses the alert signature field to determine whether alerts match. You can configure one or more standard alert fields or nested custom_info fields. The servlet joins the configured field values to create a comparison context. Two alerts match when their contexts are identical.
The configuration is disabled by default. If you do not enable it, Moogsoft Onprem continues to use alert signatures.
Before you begin
Make sure that:
You can edit
$MOOGSOFT_HOME/config/servlets.conf.You can restart Apache Tomcat.
The selected fields are populated consistently in the alerts that you want to compare.
You have identified whether field values use consistent case, spelling, and formatting.
Important
The servlet reads this setting only during startup. Restart Apache Tomcat after you enable, disable, or modify similarity_context.
Supported standard alert fields
You can specify the following alert fields:
agentagent_locationclassdescriptionexternal_idmanagersignaturesourcesource_idtype
To use a nested custom information field, specify its dot-separated path. For example:
custom_info.eventDetails.region
Situation Similarity servlet configuration
Configure the similarity_context property in the situation_similarity section of $MOOGSOFT_HOME/config/servlets.conf.
The property specifies the alert fields that the Situation Similarity servlet uses to determine whether alerts match. The servlet joins the values of the configured fields to create a comparison context. Two alerts match when their contexts are identical.
Attribute | Value |
|---|---|
Property |
|
Type | Array of strings |
Required | No |
Default behavior | Uses |
Standard fields |
|
Custom fields | A dot-separated |
Invalid fields | Ignores invalid fields and writes a warning to the servlet log |
Restart required | Yes. Restart Apache Tomcat after changing the property. |
Example:
`,similarity_context: ["class", "type", "manager", "agent"]`
Important
The servlet reads similarity_context only when it starts. Restart Apache Tomcat after you enable, disable, or modify the property.
Configure the comparison fields
To Configure the comparison fields:
Open
$MOOGSOFT_HOME/config/servlets.conf.Find the
situation_similaritysection.Locate the commented
similarity_contextproperty.Remove only the number sign (#) from the property. Keep the leading comma.
Example:
,similarity_context: ["class", "type", "manager", "agent"]
Replace the example fields with the fields that you want the Situation Similarity servlet to use.
For example, to compare alerts by
classand deployment region, specify:,similarity_context: ["class", "custom_info.eventDetails.region"]
Save the file.
Restart Apache Tomcat:
$MOOGSOFT_HOME/bin/utils/process_cntl apache-tomcat restart
Validate the configuration as described in Validate the configuration.
Note
The servlet ignores invalid fields and writes a warning to the servlet log.
Note
If similarity_context is missing or empty, or if none of its fields are valid, the servlet uses signature.
Disable context-based comparison
To Disable context-based comparison:
Open
$MOOGSOFT_HOME/config/servlets.conf.Find the
similarity_contextproperty in the Situation Similarity servlet configuration. For example:situation_similarity: { ... #,similarity_context: ["class", "type", "manager", "agent"] }Add a number sign (#) to comment out the property. For example:
#,similarity_context: ["class", "type", "manager", "agent"]
Save the file.
Restart Apache Tomcat.
Note
After Apache Tomcat restarts, the Situation Similarity servlet uses signature to compare alerts.
Validate the configuration
After Apache Tomcat starts:
Check the Situation Similarity servlet log for the following message:
Situation similarity will be calculated using the following keys: [...]
Confirm that the message lists the fields configured in
similarity_context.Check the log for warnings about invalid fields.
If the log identifies an invalid field:
Correct the field in
$MOOGSOFT_HOME/config/servlets.conf.Restart Apache Tomcat.
Check the log again.
If similarity_context is missing or empty, or if none of the configured fields are valid, the servlet uses the signature field.
Choose comparison fields
Select alert fields that represent the operational context in which you want to compare alerts.
For example:
["class", "type", "manager", "agent"]
The servlet joins the values of the four fields to create a context. Two alerts match when their contexts are identical.
You can also specify a nested custom_info field by using a dot-separated path. For example:
["custom_info.eventDetails.region"]
Important
Select fields that are populated consistently. Missing, inconsistent, case-sensitive, or highly variable values can reduce useful matches or produce unexpected similarity results.