Setting a maximum time horizon for events

You can control how long events remain visible to the solution by configuring the time horizon in the agent descriptor when you create an agent, or by using the maxHorizon property in the solution_properties.xml file.

About this task

The time horizon specifies how long events remain visible to the solution. The maxHorizon property limits the horizons that are used by the solution to control the database and memory requirements for storing events. To learn more about setting the time horizon at the agent level, see Completing the agent descriptor.

A horizon is always used. When a time horizon is not defined for an event in the agent descriptor, the maxHorizon solution property is used. If no time horizon exists in the agent descriptor and no maxHorizon solution property is defined, the system uses the default of 30 days. The longest time that you can set for maxHorizon is 68 years. For more information, see System properties.

Events that are older than the time horizon are no longer visible to the solution. Events past the horizon are not considered in the calculation of aggregates or event correlation. The maxHorizon property defines a maximum time horizon that determines how long events are retained.

The maxHorizon property overrides the time frame that is defined in a rule. For example, if a rule includes the following statement:
the number of purchase events in the last period of 1 year
And the maxHorizon is set to P6M (6 months), then the rule operates on events that are created in the past 6 months instead of 1 year.

In a production server with data persistence enabled, events that exceed the specified time horizon remain in the backup database even when they are removed from the grid. Events are removed from the grid before the specified time horizon only when the eventCacheDuration property value is smaller than the maxHorizon. Each server monitors the number of events per event type per server that are removed from the grid.

Events are removed from the database periodically after they exceed the maxHorizon.

Procedure

  1. Open the solution_properties.xml file that is in the root folder of the solution project.
  2. Add the maxHorizon property for the solution or agent to the file.

Example

The following maxHorizon property applies to the entire solution and is set to 6 months.
<property name="maxHorizon">P6M</property>