{tenantId}/log-alerts
create alert defintion for log alerts
This API is used to create log alert definitions. logs:manage scope is required to access this API.
Note:
- Values against the component field and Resource Attribute value will be used to group the alerts.
- If any string in component or Resource Attribute value or subject or description prefixes with $, it would be considered a holder. Alert service will try to fetch the value of this field in logs data and replace the placeholder.
- If any tokens are being added to the log alert definition, please ensure these tokens have a space before and after them. For example, "description": "Test host $host $name "
Request Parameters:
Parameter | Description | Mandatory / Optional | Type | Possible Values |
---|---|---|---|---|
name | Name of the Log Alert Definition | Mandatory | string | |
type | Type of Alert Definition | Mandatory | string | log |
alertNoData | Alert when no logs found with given log filter query | Mandatory | string | noalert - When user don't want any alert when no logs found against given log query |
query | Log Filter Query used to alert | Mandatory | JSON string | |
healQuery | Log Filter Query used to heal the existing critical or warning alert
| Optional | JSON string | "" |
notification.subject | Subject with which Log alert should be generated | Mandatory | string | |
notification.description | Description with which Log alert should be generated | Mandatory | string | |
conditions.severity | Severity with which log alert should be generated | Mandatory | string | warning, critical |
entityType | Select either Resource or Client. Alerts can be on a specific resource like a server, or a client-level alert. | Mandatory | string | RESOURCE, CLIENT |
component | This is to identify the alert. | Optional | string | |
resourceAttributes | Define a resource attribute to the alert. | Mandatory if entityType is Resource | JSON | |
labels | Alert custom tags. This is reflected in the alert details page | Optional | JSON | |
schedule.startTime | startTime, endTime is valid for daily, weekly and monthly patterns | mandatory for daily, weekly and monthly patterns | string | startTime and endTime difference should not be more than 2hrs. |
schedule.timezone |
Ex: Pacific/Honolulu | Optional | string | |
schedule.pattern.type | pattern type defines the alert definition schedule type | Mandatory | string | "second", "minute", "daily", "weekly", "monthly" |
schedule.pattern.repeatFrequency | defines the frequency with which logs should be checked for minute schedule pattern types. | Mandatory for second, minute, daily schedule pattern types | int | Valid values for minute frequency: |
schedule.pattern.weekDays | weekDays accepts array of days. | Mandatory for weekly schedule pattern | string | Valid values for weekDays: |
schedule.pattern.dayOfMonth | Numeric day of Month | Mandatory for monthly schedule pattern | string | 1-31 |
schedule.pattern.weekIndex schedule.pattern.dayOfWeek | weekIndex represents index of the week in the month and dayOfWeek represents day. | Mandatory for monthly schedule pattern | string | Valid values for dayOfWeek: |
Path Parameters
- tenantId
Describes the client uuid
Request Body
application/json
- alerts
Responses
- alerts
- errors
Deletes multiple log alert definitions
Path Parameters
- tenantId
Describes the client uuid
Request Body
application/json
- alertIds