|
| 1 | +--- |
| 2 | +layout: "sysdig" |
| 3 | +page_title: "Sysdig: sysdig_monitor_alert_event" |
| 4 | +sidebar_current: "docs-sysdig-monitor-alert-event" |
| 5 | +description: |- |
| 6 | + Creates a Sysdig Monitor Event Alert. |
| 7 | +--- |
| 8 | + |
| 9 | +# sysdig\_monitor\_alert\_event |
| 10 | + |
| 11 | +Creates a Sysdig Monitor Event Alert. Monitor occurrences of specific events, and alert if the total |
| 12 | +number of occurrences violates a threshold. Useful for alerting on container, orchestration, and |
| 13 | +service events like restarts and deployments. |
| 14 | + |
| 15 | +~> **Note:** This resource is still experimental, and is subject of being changed. |
| 16 | + |
| 17 | +## Example usage |
| 18 | + |
| 19 | +```hcl |
| 20 | +resource "sysdig_monitor_alert_event" "sample" { |
| 21 | + name = "[Kubernetes] Failed to pull image" |
| 22 | + description = "A Kubernetes pod failed to pull an image from the registry" |
| 23 | + severity = 4 |
| 24 | +
|
| 25 | + event_name = "Failed to pull image" |
| 26 | + source = "kubernetes" |
| 27 | + event_rel = ">" |
| 28 | + event_count = 0 |
| 29 | +
|
| 30 | + multiple_alerts_by = ["kubernetes.pod.name"] |
| 31 | + |
| 32 | + trigger_after_minutes = 1 |
| 33 | +} |
| 34 | +``` |
| 35 | + |
| 36 | +## Argument Reference |
| 37 | + |
| 38 | +### Common alert arguments |
| 39 | + |
| 40 | +These arguments are common to all alerts in Sysdig Monitor. |
| 41 | + |
| 42 | +* `name` - (Required) The name of the Monitor alert. It must be unique. |
| 43 | +* `description` - (Optional) The description of Monitor alert. |
| 44 | +* `severity` - (Optional) Severity of the Monitor alert. It must be a value between 0 and 7, |
| 45 | + with 0 being the most critical and 7 the less critical. Defaults to 4. |
| 46 | +* `trigger_after_minutes` - (Required) Threshold of time for the status to stabilize until the alert is fired. |
| 47 | +* `scope` - (Optional) Part of the infrastructure where the alert is valid. Defaults to the entire infrastructure. |
| 48 | +* `enabled` - (Optional) Boolean that defines if the alert is enabled or not. Defaults to true. |
| 49 | +* `notification_channels` - (Optional) List of notification channel IDs where an alert must be sent to once fired. |
| 50 | +* `renotification_minutes` - (Optional) Number of minutes for the alert to re-notify until the status is solved. |
| 51 | + |
| 52 | + |
| 53 | +#### Capture |
| 54 | + |
| 55 | +Enables the creation of a capture file of the syscalls during the event. |
| 56 | + |
| 57 | +* `filename` - (Required) Defines the name of the capture file. |
| 58 | +* `duration` - (Required) Time frame in seconds of the capture. |
| 59 | +* `filter` - (Optional) Additional filter to apply to the capture. For example: `proc.name contains nginx`. |
| 60 | + |
| 61 | +### Metric alert arguments |
| 62 | + |
| 63 | +* `event_name` - (Required) String that matches part of name, tag or the description of Sysdig Events. |
| 64 | +* `source` - (Required) Source of the event. It can be `docker` or `kubernetes`. |
| 65 | +* `event_rel` - (Required) Relationship of the event count. It can be `>`, `>=`, `<`, `<=`, `=` or `!=`. |
| 66 | +* `event_count` - (Required) Number of events to match with event_rel. |
| 67 | +* `multiple_alerts_by` - (Optional) List of segments to trigger a separate alert on. Example: `["kubernetes.cluster.name", "kubernetes.namespace.name"]`. |
| 68 | + |
| 69 | +## Attributes Reference |
| 70 | + |
| 71 | +### Common alert attributes |
| 72 | + |
| 73 | +In addition to all arguments above, the following attributes are exported, which are common to all the |
| 74 | +alerts in Sysdig Monitor: |
| 75 | + |
| 76 | +* `version` - Current version of the resource in Sysdig Monitor. |
| 77 | +* `team` - Team ID that owns the alert. |
0 commit comments