Alerting based on monitoring logs
A logs-based alerting component, ElastAlert, is part of the IBM FCI logging stack. Using ElastAlert, you can add specific rules
to monitor the logs and alert, based on the rules configured. IBM FCI does not ship any concrete rules; however, IBM FCI has a rule that traps the errors and exceptions in the
message log of the Case Manager fci-solution.
Procedure
To add a new rule to ElastAlert:
Results
```
#Rule Name
name: Case-Manager-Exceptions
# Type of alert.
# the frequency rule type alerts when num_events events occur with timeframe time
type: frequency
# (Required)
# Index to search, wildcard supported
index: filebeat*
# (Required, frequency specific)
# Alert when this many documents matching the query occur within a timeframe
num_events: 1
# (Required, frequency specific)
# num_events must occur within this amount of time to trigger an alert
timeframe:
hours: 1
# By setting realert, you will prevent the same rule from alerting twice in an amount of time.
realert:
minutes: 0
# The aggregation feature will take every alert that has occured over a period of time and send them together in
# one alert.
aggregation:
hours: 2
# (Required)
# A list of Elasticsearch filters used for find events
# These filters are joined with AND and nested in a filtered query
# For more info: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl.html
filter:
- query:
bool:
must:
- match:
kubernetes.labels.app: "case-manager-fci-solution"
- match:
kubernetes.container.name: "message-log"
- bool:
should:
- match_phrase:
message: "exception"
- match_phrase:
message: "error"
# (Required)
# The alert is use when a match is found
alert:
- command
command: ["echo", "case-manager error"]
```
For detailed information about configuration parameters, refer to ElastAlert documentation.