Skip to main content

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:

  • agent

  • agent_location

  • class

  • description

  • external_id

  • manager

  • signature

  • source

  • source_id

  • type

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

similarity_context

Type

Array of strings

Required

No

Default behavior

Uses signature when the property is missing, commented out, empty, or contains no valid fields

Standard fields

agent, agent_location, class, description, external_id, manager, signature, source, source_id, and type

Custom fields

A dot-separated custom_info path, such as custom_info.eventDetails.region

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:

  1. Open $MOOGSOFT_HOME/config/servlets.conf.

  2. Find the situation_similarity section.

  3. Locate the commented similarity_context property.

  4. Remove only the number sign (#) from the property. Keep the leading comma.

    Example:

    ,similarity_context: ["class", "type", "manager", "agent"]
  5. Replace the example fields with the fields that you want the Situation Similarity servlet to use.

    For example, to compare alerts by class and deployment region, specify:

    ,similarity_context: ["class", "custom_info.eventDetails.region"]
  6. Save the file.

  7. Restart Apache Tomcat:

    $MOOGSOFT_HOME/bin/utils/process_cntl apache-tomcat restart
  8. 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:

  1. Open $MOOGSOFT_HOME/config/servlets.conf.

  2. Find the similarity_context property in the Situation Similarity servlet configuration. For example:

    situation_similarity:
    {
        ...
        #,similarity_context: ["class", "type", "manager", "agent"]
    }
  3. Add a number sign (#) to comment out the property. For example:

    #,similarity_context: ["class", "type", "manager", "agent"]
  4. Save the file.

  5. Restart Apache Tomcat.

Note

After Apache Tomcat restarts, the Situation Similarity servlet uses signature to compare alerts.

Validate the configuration

After Apache Tomcat starts:

  1. Check the Situation Similarity servlet log for the following message:

    Situation similarity will be calculated using the following keys: [...]

  2. Confirm that the message lists the fields configured in similarity_context.

  3. Check the log for warnings about invalid fields.

  4. If the log identifies an invalid field:

    1. Correct the field in $MOOGSOFT_HOME/config/servlets.conf.

    2. Restart Apache Tomcat.

    3. 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.