page_title | subcategory | description |
---|---|---|
coralogix_alert Resource - terraform-provider-coralogix |
Coralogix Alert. For more info please review - https://coralogix.com/docs/getting-started-with-coralogix-alerts/. |
Coralogix Alert. For more info please review - https://coralogix.com/docs/getting-started-with-coralogix-alerts/.
terraform {
required_providers {
coralogix = {
version = "~> 2.0"
source = "coralogix/coralogix"
}
}
}
provider "coralogix" {
#api_key = "<add your api key here or add env variable CORALOGIX_API_KEY>"
#env = "<add the environment you want to work at or add env variable CORALOGIX_ENV>"
}
resource "coralogix_alert" "test" {
name = "logs_immediate alert"
description = "Example of logs_immediate alert from terraform"
priority = "P2"
labels = {
alert_type = "security"
security_severity = "high"
}
incidents_settings = {
notify_on = "Triggered and Resolved"
retriggering_period = {
minutes = 10
}
}
schedule = {
active_on = {
days_of_week = ["Wednesday", "Thursday"]
start_time = "08:30"
end_time = "20:30"
}
}
type_definition = {
logs_immediate = {
logs_filter = {
simple_filter = {
lucene_query = "message:\"error\""
}
}
}
}
}
resource "coralogix_alert" "test" {
name = "logs_anomaly alert example"
description = "Example of logs_anomaly alert from terraform"
priority = "P4"
labels = {
alert_type = "security"
security_severity = "high"
}
notification_group = {
webhooks_settings = [{
retriggering_period = {
minutes = 1
}
notify_on = "Triggered and Resolved"
recipients = ["[email protected]"]
}]
}
incidents_settings = {
notify_on = "Triggered and Resolved"
retriggering_period = {
minutes = 1
}
}
schedule = {
active_on = {
days_of_week = ["Wednesday", "Thursday"]
start_time = "08:30"
end_time = "20:30"
}
}
type_definition = {
logs_anomaly = {
rules = [{
condition = {
minimum_threshold = 2
time_window = "10_MINUTES"
}
override = {
priority = "P2"
}
}]
logs_filter = {
simple_filter = {
lucene_query = "message:\"error\""
label_filters = {
application_name = [{
operation = "IS"
value = "nginx"
}]
subsystem_name = [{
operation = "IS"
value = "subsystem-name"
}]
severities = ["Warning"]
}
}
}
notification_payload_filter = [
"coralogix.metadata.sdkId", "coralogix.metadata.sdkName", "coralogix.metadata.sdkVersion"
]
}
}
}
resource "coralogix_alert" "test" {
name = "logs_threshold alert example"
description = "Example of logs_threshold alert example from terraform"
priority = "P2"
labels = {
alert_type = "security"
security_severity = "high"
}
notification_group = {
webhooks_settings = [{
recipients = ["[email protected]", "[email protected]"]
}]
}
incidents_settings = {
notify_on = "Triggered and Resolved"
retriggering_period = {
minutes = 1
}
}
schedule = {
active_on = {
days_of_week = ["Wednesday", "Thursday"]
start_time = "10:30"
end_time = "20:30"
}
}
type_definition = {
logs_threshold = {
rules = [{
condition = {
threshold = 2
time_window = "10_MINUTES"
condition_type = "LESS_THAN"
}
override = {
priority = "P2"
}
}]
logs_filter = {
simple_filter = {
lucene_query = "message:\"error\""
label_filters = {
application_name = [{
operation = "NOT"
value = "application_name"
}]
subsystem_name = [{
operation = "STARTS_WITH"
value = "subsystem-name"
}]
severities = ["Warning", "Error"]
}
}
}
}
}
}
resource "coralogix_alert" "test" {
name = "logs_ratio_threshold alert example"
description = "Example of logs_ratio_threshold alert from terraform"
priority = "P3"
group_by = ["coralogix.metadata.alert_id", "coralogix.metadata.alert_name"]
type_definition = {
logs_ratio_threshold = {
numerator_alias = "numerator"
denominator_alias = "denominator"
rules = [{
condition = {
threshold = 2
time_window = "10_MINUTES"
condition_type = "LESS_THAN"
}
override = {
priority = "P2"
}
}]
group_by_for = "Denominator Only"
}
}
}
resource "coralogix_alert" "test" {
name = "logs_new_value alert example"
description = "Example of logs_new_value alert from terraform"
priority = "P2"
type_definition = {
logs_new_value = {
notification_payload_filter = ["coralogix.metadata.sdkId", "coralogix.metadata.sdkName", "coralogix.metadata.sdkVersion"]
rules = [{
condition = {
time_window = "24_HOURS"
keypath_to_track = "remote_addr_geoip.country_name"
}
override = {
priority = "P2"
}
}]
}
}
}
resource "coralogix_alert" "test" {
name = "logs_unique_count alert example"
description = "Example of logs_unique_count alert from terraform"
priority = "P2"
group_by = ["remote_addr_geoip.city_name"]
type_definition = {
logs_unique_count = {
unique_count_keypath = "remote_addr_geoip.country_name"
max_unique_count_per_group_by_key = 500
rules = [ {
condition = {
max_unique_count = 2
time_window = "5_MINUTES"
}
}]
}
}
}
resource "coralogix_alert" "test" {
name = "logs_time_relative_threshold alert example"
description = "Example of logs_time_relative_threshold alert from terraform"
priority = "P3"
type_definition = {
logs_time_relative_threshold = {
rules = [{
condition = {
threshold = 50
compared_to = "Same Day Last Week"
ignore_infinity = false
condition_type = "LESS_THAN"
}
override = {
priority = "P2"
}
}]
undetected_values_management = {
trigger_undetected_values = true
auto_retire_timeframe = "6_HOURS"
}
}
}
}
resource "coralogix_alert" "test" {
name = "metric_anomaly alert example"
description = "Example of metric_anomaly alert from terraform"
priority = "P1"
type_definition = {
metric_anomaly = {
metric_filter = {
promql = "sum(rate(http_requests_total{job=\"api-server\"}[5m])) by (status)"
}
rules = [{
condition = {
threshold = 2
for_over_pct = 10
of_the_last = "10_MINUTES"
condition_type = "LESS_THAN"
min_non_null_values_pct = 50
}
}]
}
}
}
resource "coralogix_alert" "test" {
name = "metric_threshold alert example"
description = "Example of metric_threshold alert from terraform"
priority = "P3"
type_definition = {
metric_threshold = {
metric_filter = {
promql = "sum(rate(http_requests_total{job=\"api-server\"}[5m])) by (status)"
}
rules = [{
condition = {
threshold = 2
for_over_pct = 10
of_the_last = "10_MINUTES"
condition_type = "MORE_THAN_OR_EQUALS"
}
override = {
priority = "P2"
}
}]
missing_values = {
replace_with_zero = true
}
}
}
}
resource "coralogix_alert" "test" {
name = "tracing_immediate alert example"
description = "Example of tracing_immediate alert from terraform"
priority = "P1"
type_definition = {
tracing_immediate = {
tracing_filter = {
latency_threshold_ms = 100
tracing_label_filters = {
application_name = [
{
operation = "IS"
values = ["nginx", "apache"]
},
{
operation = "STARTS_WITH"
values = ["application-name:"]
}
]
subsystem_name = [
{
values = ["subsystem-name"]
}
]
operation_name = [
{
values = ["operation-name"]
}
]
span_fields = [
{
key = "status"
filter_type = {
values = ["200"]
}
},
{
key = "status"
filter_type = {
operation = "STARTS_WITH"
values = ["40", "50"]
}
},
]
}
}
}
}
}
resource "coralogix_alert" "test" {
name = "tracing_threshold alert example"
description = "Example of tracing_threshold alert from terraform"
priority = "P2"
type_definition = {
tracing_threshold = {
tracing_filter = {
latency_threshold_ms = 100
tracing_label_filters = {
application_name = [
{
operation = "IS"
values = ["nginx", "apache"]
},
{
operation = "STARTS_WITH"
values = ["application-name:"]
}
]
}
}
rules = [{
condition = {
time_window = "10_MINUTES"
span_amount = 5
}
}]
}
}
}
resource "coralogix_alert" "test_1"{
name = "logs immediate alert 1"
priority = "P1"
type_definition = {
logs_immediate = {
}
}
}
resource "coralogix_alert" "test_2"{
name = "logs immediate alert 2"
priority = "P2"
type_definition = {
logs_immediate = {
}
}
}
resource "coralogix_alert" "test_3"{
name = "logs immediate alert 3"
priority = "P3"
type_definition = {
logs_immediate = {
}
}
}
resource "coralogix_alert" "test_4"{
name = "logs immediate alert 4"
priority = "P4"
type_definition = {
logs_immediate = {
}
}
}
resource "coralogix_alert" "test" {
name = "flow alert example"
description = "Example of flow alert from terraform"
priority = "P3"
type_definition = {
flow = {
enforce_suppression = false
stages = [{
flow_stages_groups = [{
alert_defs = [
{
id = coralogix_alert.test_1.id
},
{
id = coralogix_alert.test_2.id
},
]
next_op = "AND"
alerts_op = "OR"
},
{
alert_defs = [
{
id = coralogix_alert.test_3.id
},
{
id = coralogix_alert.test_4.id
},
]
next_op = "OR"
alerts_op = "AND"
},]
timeframe_ms = 10
timeframe_type = "Up To"
}]
}
}
}
name
(String) Alert name.priority
(String) Alert priority. Valid values: ["P1" "P2" "P3" "P4" "P5"].type_definition
(Attributes) Alert type definition. Exactly one of the following must be specified: logs_immediate, logs_threshold, logs_anomaly, logs_ratio_threshold, logs_new_value, logs_unique_count, logs_time_relative_threshold, metric_threshold, metric_anomaly, tracing_immediate, tracing_threshold flow. (see below for nested schema)
description
(String) Alert description.enabled
(Boolean) Alert enabled status. True by default.group_by
(List of String) Group by fields.incidents_settings
(Attributes) (see below for nested schema)labels
(Map of String)notification_group
(Attributes) (see below for nested schema)phantom_mode
(Boolean)schedule
(Attributes) Alert schedule. Will be activated all the time if not specified. (see below for nested schema)
deleted
(Boolean)id
(String) Alert ID.
Optional:
flow
(Attributes) (see below for nested schema)logs_anomaly
(Attributes) (see below for nested schema)logs_immediate
(Attributes) (see below for nested schema)logs_new_value
(Attributes) (see below for nested schema)logs_ratio_threshold
(Attributes) (see below for nested schema)logs_threshold
(Attributes) (see below for nested schema)logs_time_relative_threshold
(Attributes) (see below for nested schema)logs_unique_count
(Attributes) (see below for nested schema)metric_anomaly
(Attributes) (see below for nested schema)metric_threshold
(Attributes) (see below for nested schema)tracing_immediate
(Attributes) (see below for nested schema)tracing_threshold
(Attributes) (see below for nested schema)
Required:
stages
(Attributes List) (see below for nested schema)
Optional:
enforce_suppression
(Boolean)
Required:
flow_stages_groups
(Attributes List) (see below for nested schema)timeframe_type
(String)
Optional:
timeframe_ms
(Number)
Required:
alert_defs
(Attributes Set) (see below for nested schema)alerts_op
(String) Alerts operation. Valid values: ["AND" "OR"].next_op
(String) Next operation. Valid values: ["AND" "OR"].
Required:
id
(String)
Optional:
not
(Boolean)
Required:
rules
(Attributes Set) (see below for nested schema)
Optional:
logs_filter
(Attributes) (see below for nested schema)notification_payload_filter
(Set of String)
Required:
condition
(Attributes) (see below for nested schema)
Required:
minimum_threshold
(Number)time_window
(String)
Read-Only:
condition_type
(String)
Optional:
simple_filter
(Attributes) (see below for nested schema)
Optional:
label_filters
(Attributes) (see below for nested schema)lucene_query
(String)
Optional:
application_name
(Attributes Set) (see below for nested schema)severities
(Set of String) Severities. Valid values: ["Critical" "Debug" "Error" "Info" "Unspecified" "Warning"].subsystem_name
(Attributes Set) (see below for nested schema)
Nested Schema for type_definition.logs_anomaly.logs_filter.simple_filter.label_filters.application_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Nested Schema for type_definition.logs_anomaly.logs_filter.simple_filter.label_filters.subsystem_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Optional:
logs_filter
(Attributes) (see below for nested schema)notification_payload_filter
(Set of String)
Optional:
simple_filter
(Attributes) (see below for nested schema)
Optional:
label_filters
(Attributes) (see below for nested schema)lucene_query
(String)
Optional:
application_name
(Attributes Set) (see below for nested schema)severities
(Set of String) Severities. Valid values: ["Critical" "Debug" "Error" "Info" "Unspecified" "Warning"].subsystem_name
(Attributes Set) (see below for nested schema)
Nested Schema for type_definition.logs_immediate.logs_filter.simple_filter.label_filters.application_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Nested Schema for type_definition.logs_immediate.logs_filter.simple_filter.label_filters.subsystem_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Required:
rules
(Attributes Set) (see below for nested schema)
Optional:
logs_filter
(Attributes) (see below for nested schema)notification_payload_filter
(Set of String)
Required:
condition
(Attributes) (see below for nested schema)
Required:
keypath_to_track
(String)time_window
(String)
Optional:
simple_filter
(Attributes) (see below for nested schema)
Optional:
label_filters
(Attributes) (see below for nested schema)lucene_query
(String)
Optional:
application_name
(Attributes Set) (see below for nested schema)severities
(Set of String) Severities. Valid values: ["Critical" "Debug" "Error" "Info" "Unspecified" "Warning"].subsystem_name
(Attributes Set) (see below for nested schema)
Nested Schema for type_definition.logs_new_value.logs_filter.simple_filter.label_filters.application_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Nested Schema for type_definition.logs_new_value.logs_filter.simple_filter.label_filters.subsystem_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Required:
denominator_alias
(String)numerator_alias
(String)rules
(Attributes Set) (see below for nested schema)
Optional:
denominator
(Attributes) (see below for nested schema)group_by_for
(String) Group by for. Valid values: ["Both" "Denominator Only" "Numerator Only"]. 'Both' by default.notification_payload_filter
(Set of String)numerator
(Attributes) (see below for nested schema)
Required:
condition
(Attributes) (see below for nested schema)override
(Attributes) (see below for nested schema)
Required:
condition_type
(String) Condition to evaluate the threshold with. Valid values: ["LESS_THAN" "MORE_THAN"].threshold
(Number)time_window
(String)
Optional:
priority
(String) Alert priority. Valid values: ["P1" "P2" "P3" "P4" "P5"].
Optional:
simple_filter
(Attributes) (see below for nested schema)
Optional:
label_filters
(Attributes) (see below for nested schema)lucene_query
(String)
Optional:
application_name
(Attributes Set) (see below for nested schema)severities
(Set of String) Severities. Valid values: ["Critical" "Debug" "Error" "Info" "Unspecified" "Warning"].subsystem_name
(Attributes Set) (see below for nested schema)
Nested Schema for type_definition.logs_ratio_threshold.denominator.simple_filter.label_filters.application_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Nested Schema for type_definition.logs_ratio_threshold.denominator.simple_filter.label_filters.subsystem_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Optional:
simple_filter
(Attributes) (see below for nested schema)
Optional:
label_filters
(Attributes) (see below for nested schema)lucene_query
(String)
Optional:
application_name
(Attributes Set) (see below for nested schema)severities
(Set of String) Severities. Valid values: ["Critical" "Debug" "Error" "Info" "Unspecified" "Warning"].subsystem_name
(Attributes Set) (see below for nested schema)
Nested Schema for type_definition.logs_ratio_threshold.numerator.simple_filter.label_filters.application_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Nested Schema for type_definition.logs_ratio_threshold.numerator.simple_filter.label_filters.subsystem_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Required:
rules
(Attributes Set) (see below for nested schema)
Optional:
logs_filter
(Attributes) (see below for nested schema)notification_payload_filter
(Set of String)undetected_values_management
(Attributes) (see below for nested schema)
Required:
condition
(Attributes) (see below for nested schema)override
(Attributes) (see below for nested schema)
Required:
condition_type
(String) Condition to evaluate the threshold with. Valid values: ["LESS_THAN" "MORE_THAN"].threshold
(Number)time_window
(String)
Optional:
priority
(String) Alert priority. Valid values: ["P1" "P2" "P3" "P4" "P5"].
Optional:
simple_filter
(Attributes) (see below for nested schema)
Optional:
label_filters
(Attributes) (see below for nested schema)lucene_query
(String)
Optional:
application_name
(Attributes Set) (see below for nested schema)severities
(Set of String) Severities. Valid values: ["Critical" "Debug" "Error" "Info" "Unspecified" "Warning"].subsystem_name
(Attributes Set) (see below for nested schema)
Nested Schema for type_definition.logs_threshold.logs_filter.simple_filter.label_filters.application_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Nested Schema for type_definition.logs_threshold.logs_filter.simple_filter.label_filters.subsystem_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Optional:
auto_retire_timeframe
(String) Auto retire timeframe. Valid values: ["10_MINUTES" "12_HOURS" "1_HOUR" "24_HOURS" "2_HOURS" "5_MINUTES" "6_HOURS" "NEVER"].trigger_undetected_values
(Boolean)
Required:
rules
(Attributes Set) (see below for nested schema)
Optional:
logs_filter
(Attributes) (see below for nested schema)notification_payload_filter
(Set of String)undetected_values_management
(Attributes) (see below for nested schema)
Required:
condition
(Attributes) (see below for nested schema)override
(Attributes) (see below for nested schema)
Required:
compared_to
(String) Compared to a different time frame. Valid values: ["Previous Hour" "Same Day Last Month" "Same Day Last Week" "Same Hour Last Week" "Same Hour Yesterday" "Yesterday"].condition_type
(String) Condition . Valid values: ["LESS_THAN" "MORE_THAN"].threshold
(Number)
Optional:
priority
(String) Alert priority. Valid values: ["P1" "P2" "P3" "P4" "P5"].
Optional:
simple_filter
(Attributes) (see below for nested schema)
Optional:
label_filters
(Attributes) (see below for nested schema)lucene_query
(String)
Nested Schema for type_definition.logs_time_relative_threshold.logs_filter.simple_filter.label_filters
Optional:
application_name
(Attributes Set) (see below for nested schema)severities
(Set of String) Severities. Valid values: ["Critical" "Debug" "Error" "Info" "Unspecified" "Warning"].subsystem_name
(Attributes Set) (see below for nested schema)
Nested Schema for type_definition.logs_time_relative_threshold.logs_filter.simple_filter.label_filters.application_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Nested Schema for type_definition.logs_time_relative_threshold.logs_filter.simple_filter.label_filters.subsystem_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Optional:
auto_retire_timeframe
(String) Auto retire timeframe. Valid values: ["10_MINUTES" "12_HOURS" "1_HOUR" "24_HOURS" "2_HOURS" "5_MINUTES" "6_HOURS" "NEVER"].trigger_undetected_values
(Boolean)
Required:
rules
(Attributes Set) (see below for nested schema)unique_count_keypath
(String)
Optional:
logs_filter
(Attributes) (see below for nested schema)max_unique_count_per_group_by_key
(Number)notification_payload_filter
(Set of String)
Required:
condition
(Attributes) (see below for nested schema)
Required:
max_unique_count
(Number)time_window
(String)
Optional:
simple_filter
(Attributes) (see below for nested schema)
Optional:
label_filters
(Attributes) (see below for nested schema)lucene_query
(String)
Optional:
application_name
(Attributes Set) (see below for nested schema)severities
(Set of String) Severities. Valid values: ["Critical" "Debug" "Error" "Info" "Unspecified" "Warning"].subsystem_name
(Attributes Set) (see below for nested schema)
Nested Schema for type_definition.logs_unique_count.logs_filter.simple_filter.label_filters.application_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Nested Schema for type_definition.logs_unique_count.logs_filter.simple_filter.label_filters.subsystem_name
Required:
value
(String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "IS" "NOT" "STARTS_WITH"].'IS' by default.
Required:
metric_filter
(Attributes) (see below for nested schema)rules
(Attributes Set) (see below for nested schema)
Required:
promql
(String)
Required:
condition
(Attributes) (see below for nested schema)
Required:
condition_type
(String) Condition to evaluate the threshold with. Valid values: ["LESS_THAN" "MORE_THAN"].for_over_pct
(Number)min_non_null_values_pct
(Number)of_the_last
(String) Time window to evaluate the threshold with. Valid values: ["10_MINUTES" "12_HOURS" "15_MINUTES" "1_HOUR" "1_MINUTE" "20_MINUTES" "24_HOURS" "2_HOURS" "30_MINUTES" "36_HOURS" "4_HOURS" "5_MINUTES" "6_HOURS"].threshold
(Number)
Required:
metric_filter
(Attributes) (see below for nested schema)missing_values
(Attributes) (see below for nested schema)rules
(Attributes Set) (see below for nested schema)
Optional:
undetected_values_management
(Attributes) (see below for nested schema)
Required:
promql
(String)
Optional:
min_non_null_values_pct
(Number)replace_with_zero
(Boolean)
Required:
condition
(Attributes) (see below for nested schema)override
(Attributes) (see below for nested schema)
Required:
condition_type
(String) Condition to evaluate the threshold with. Valid values: ["LESS_THAN" "LESS_THAN_OR_EQUALS" "MORE_THAN" "MORE_THAN_OR_EQUALS"].for_over_pct
(Number)of_the_last
(String) Time window to evaluate the threshold with. Valid values: ["10_MINUTES" "12_HOURS" "15_MINUTES" "1_HOUR" "1_MINUTE" "20_MINUTES" "24_HOURS" "2_HOURS" "30_MINUTES" "36_HOURS" "4_HOURS" "5_MINUTES" "6_HOURS"].threshold
(Number)
Optional:
priority
(String) Alert priority. Valid values: ["P1" "P2" "P3" "P4" "P5"].
Optional:
auto_retire_timeframe
(String) Auto retire timeframe. Valid values: ["10_MINUTES" "12_HOURS" "1_HOUR" "24_HOURS" "2_HOURS" "5_MINUTES" "6_HOURS" "NEVER"].trigger_undetected_values
(Boolean)
Required:
tracing_filter
(Attributes) (see below for nested schema)
Optional:
notification_payload_filter
(Set of String)
Required:
latency_threshold_ms
(Number)tracing_label_filters
(Attributes) (see below for nested schema)
Optional:
application_name
(Attributes Set) (see below for nested schema)operation_name
(Attributes Set) (see below for nested schema)service_name
(Attributes Set) (see below for nested schema)span_fields
(Attributes Set) (see below for nested schema)subsystem_name
(Attributes Set) (see below for nested schema)
Nested Schema for type_definition.tracing_immediate.tracing_filter.tracing_label_filters.application_name
Required:
values
(Set of String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "INCLUDES" "IS" "IS_NOT" "STARTS_WITH"]. 'IS' by default.
Nested Schema for type_definition.tracing_immediate.tracing_filter.tracing_label_filters.operation_name
Required:
values
(Set of String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "INCLUDES" "IS" "IS_NOT" "STARTS_WITH"]. 'IS' by default.
Nested Schema for type_definition.tracing_immediate.tracing_filter.tracing_label_filters.service_name
Required:
values
(Set of String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "INCLUDES" "IS" "IS_NOT" "STARTS_WITH"]. 'IS' by default.
Nested Schema for type_definition.tracing_immediate.tracing_filter.tracing_label_filters.span_fields
Required:
key
(String)
Optional:
filter_type
(Attributes) (see below for nested schema)
Nested Schema for type_definition.tracing_immediate.tracing_filter.tracing_label_filters.span_fields.filter_type
Required:
values
(Set of String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "INCLUDES" "IS" "IS_NOT" "STARTS_WITH"]. 'IS' by default.
Nested Schema for type_definition.tracing_immediate.tracing_filter.tracing_label_filters.subsystem_name
Required:
values
(Set of String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "INCLUDES" "IS" "IS_NOT" "STARTS_WITH"]. 'IS' by default.
Required:
rules
(Attributes Set) (see below for nested schema)tracing_filter
(Attributes) (see below for nested schema)
Optional:
notification_payload_filter
(Set of String)
Required:
condition
(Attributes) (see below for nested schema)
Required:
span_amount
(Number)time_window
(String)
Read-Only:
condition_type
(String)
Required:
latency_threshold_ms
(Number)tracing_label_filters
(Attributes) (see below for nested schema)
Optional:
application_name
(Attributes Set) (see below for nested schema)operation_name
(Attributes Set) (see below for nested schema)service_name
(Attributes Set) (see below for nested schema)span_fields
(Attributes Set) (see below for nested schema)subsystem_name
(Attributes Set) (see below for nested schema)
Nested Schema for type_definition.tracing_threshold.tracing_filter.tracing_label_filters.application_name
Required:
values
(Set of String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "INCLUDES" "IS" "IS_NOT" "STARTS_WITH"]. 'IS' by default.
Nested Schema for type_definition.tracing_threshold.tracing_filter.tracing_label_filters.operation_name
Required:
values
(Set of String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "INCLUDES" "IS" "IS_NOT" "STARTS_WITH"]. 'IS' by default.
Nested Schema for type_definition.tracing_threshold.tracing_filter.tracing_label_filters.service_name
Required:
values
(Set of String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "INCLUDES" "IS" "IS_NOT" "STARTS_WITH"]. 'IS' by default.
Nested Schema for type_definition.tracing_threshold.tracing_filter.tracing_label_filters.span_fields
Required:
key
(String)
Optional:
filter_type
(Attributes) (see below for nested schema)
Nested Schema for type_definition.tracing_threshold.tracing_filter.tracing_label_filters.span_fields.filter_type
Required:
values
(Set of String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "INCLUDES" "IS" "IS_NOT" "STARTS_WITH"]. 'IS' by default.
Nested Schema for type_definition.tracing_threshold.tracing_filter.tracing_label_filters.subsystem_name
Required:
values
(Set of String)
Optional:
operation
(String) Operation. Valid values: ["ENDS_WITH" "INCLUDES" "IS" "IS_NOT" "STARTS_WITH"]. 'IS' by default.
Required:
notify_on
(String) Notify on. Valid values: ["Triggered Only" "Triggered and Resolved"].retriggering_period
(Attributes) (see below for nested schema)
Required:
minutes
(Number)
Optional:
group_by_keys
(List of String)webhooks_settings
(Attributes Set) (see below for nested schema)
Optional:
integration_id
(String)notify_on
(String) Notify on. Valid values: ["Triggered Only" "Triggered and Resolved"]. Triggered Only by default.recipients
(Set of String)retriggering_period
(Attributes) Retriggering period in minutes. 10 minutes by default. (see below for nested schema)
Required:
minutes
(Number)
Required:
active_on
(Attributes) (see below for nested schema)
Required:
days_of_week
(Set of String) Days of the week. Valid values: ["Friday" "Monday" "Saturday" "Sunday" "Thursday" "Tuesday" "Wednesday"].end_time
(String)start_time
(String)
Optional:
utc_offset
(String)
Import is supported using the following syntax:
# Create an import file like this
tee -a import.tf <<EOF
terraform {
required_providers {
coralogix = {
version = "~> 2.0"
source = "coralogix/coralogix"
}
}
}
provider "coralogix" {
#api_key = "<add your api key here or add env variable CORALOGIX_API_KEY>"
#env = "<add the environment you want to work at or add env variable CORALOGIX_ENV>"
}
#
#import {
# to = coralogix_alert.logs_immediate_alert
# id = "19e27a6d-470d-47e9-9447-d1a1bb512eb6"
#}
#
#import {
# to = coralogix_alert.flow_alert_example
# id = "41544404-db3c-4d6e-b039-b8cc3efd51f8"
#}
#
#import {
# to = coralogix_alert.logs_new_value
# id = "4c760ad4-2eb4-444b-9285-8a86f3eda7cb"
#}
#
#import {
# to = coralogix_alert.tracing_more_than
# id = "b8529327-87e2-4140-89df-3541d3171f1a"
#}
#
#import {
# to = coralogix_alert.logs-ratio-more-than
# id = "187f3ea4-caa7-46e1-82c0-2dfd1e67a680"
#}
EOF
## Follow the Migration Guide to obtain the following:
# __generated__ by Terraform
# Please review these resources and move them into your main configuration files.
# __generated__ by Terraform from "4c760ad4-2eb4-444b-9285-8a86f3eda7cb"
#resource "coralogix_alert" "logs_new_value" {
# deleted = false
# description = "Example of logs-new-value alert from terraform"
# enabled = true
# group_by = null
# incidents_settings = {
# notify_on = "Triggered Only"
# retriggering_period = {
# minutes = 10
# }
# }
# labels = null
# name = "logs-new-value alert example"
# notification_group = {
# group_by_keys = null
# webhooks_settings = null
# }
# phantom_mode = false
# priority = "P2"
# schedule = null
# type_definition = {
# flow = null
# logs_anomaly = null
# logs_immediate = null
# logs_new_value = {
# logs_filter = {
# simple_filter = {
# label_filters = {
# application_name = null
# severities = null
# subsystem_name = null
# }
# lucene_query = null
# }
# }
# notification_payload_filter = ["coralogix.metadata.sdkId", "coralogix.metadata.sdkName", "coralogix.metadata.sdkVersion"]
# rules = [
# {
# condition = {
# keypath_to_track = "remote_addr_geoip.country_name"
# time_window = {
# specific_value = "12_HOURS"
# }
# }
# },
# ]
# }
# logs_ratio_threshold = null
# logs_threshold = null
# logs_time_relative_threshold = null
# logs_unique_count = null
# metric_anomaly = null
# metric_threshold = null
# tracing_immediate = null
# tracing_threshold = null
# }
#}
#
## __generated__ by Terraform from "41544404-db3c-4d6e-b039-b8cc3efd51f8"
#resource "coralogix_alert" "flow_alert_example" {
# deleted = false
# description = "Example of flow alert from terraform"
# enabled = true
# group_by = null
# incidents_settings = {
# notify_on = "Triggered Only"
# retriggering_period = {
# minutes = 10
# }
# }
# labels = null
# name = "flow alert example"
# notification_group = {
# group_by_keys = null
# webhooks_settings = null
# }
# phantom_mode = false
# priority = "P3"
# schedule = null
# type_definition = {
# flow = {
# enforce_suppression = false
# stages = [
# {
# flow_stages_groups = [
# {
# alert_defs = [
# {
# id = "5c197c44-a51d-4c70-a90a-77a4a21ae3d8"
# not = false
# },
# {
# id = "f8a782a1-a503-4987-884f-7dac4b834b03"
# not = false
# },
# ]
# alerts_op = "OR"
# next_op = "AND"
# },
# {
# alert_defs = [
# {
# id = "81bba4f8-332c-4bc4-b5d2-bd074a4f969e"
# not = false
# },
# {
# id = "f8a782a1-a503-4987-884f-7dac4b834b03"
# not = false
# },
# ]
# alerts_op = "AND"
# next_op = "OR"
# },
# ]
# timeframe_ms = 10
# timeframe_type = "Up To"
# },
# ]
# }
# logs_anomaly = null
# logs_immediate = null
# logs_new_value = null
# logs_ratio_threshold = null
# logs_threshold = null
# logs_time_relative_threshold = null
# logs_unique_count = null
# metric_anomaly = null
# metric_threshold = null
# tracing_immediate = null
# tracing_threshold = null
# }
#}
#
## __generated__ by Terraform from "19e27a6d-470d-47e9-9447-d1a1bb512eb6"
#resource "coralogix_alert" "logs_immediate_alert" {
# deleted = false
# description = "Example of logs immediate alert from terraform"
# enabled = true
# group_by = null
# incidents_settings = {
# notify_on = "Triggered and Resolved"
# retriggering_period = {
# minutes = 10
# }
# }
# labels = {
# alert_type = "security"
# security_severity = "high"
# }
# name = "logs immediate alert"
# notification_group = {
# group_by_keys = null
# webhooks_settings = null
# }
# phantom_mode = false
# priority = "P2"
# schedule = {
# active_on = {
# days_of_week = ["Wednesday", "Thursday"]
# end_time = {
# hours = 20
# minutes = 30
# }
# start_time = {
# hours = 8
# minutes = 30
# }
# }
# }
# type_definition = {
# flow = null
# logs_anomaly = null
# logs_immediate = {
# logs_filter = {
# simple_filter = {
# label_filters = {
# application_name = null
# severities = null
# subsystem_name = null
# }
# lucene_query = "message:\"error\""
# }
# }
# notification_payload_filter = null
# }
# logs_new_value = null
# logs_ratio_threshold = null
# logs_threshold = null
# logs_time_relative_threshold = null
# logs_unique_count = null
# metric_anomaly = null
# metric_threshold = null
# tracing_immediate = null
# tracing_threshold = null
# }
#}
#
## __generated__ by Terraform from "187f3ea4-caa7-46e1-82c0-2dfd1e67a680"
#resource "coralogix_alert" "logs-ratio-more-than" {
# deleted = false
# description = "Example of logs-ratio-more-than alert from terraform"
# enabled = true
# group_by = ["coralogix.metadata.alert_id", "coralogix.metadata.alert_name"]
# incidents_settings = {
# notify_on = "Triggered Only"
# retriggering_period = {
# minutes = 10
# }
# }
# labels = null
# name = "logs-ratio-more-than alert example"
# notification_group = {
# group_by_keys = ["coralogix.metadata.alert_id", "coralogix.metadata.alert_name"]
# webhooks_settings = null
# }
# phantom_mode = false
# priority = "P1"
# schedule = null
# type_definition = {
# flow = null
# logs_anomaly = null
# logs_immediate = null
# logs_new_value = null
# logs_ratio_threshold = {
# denominator = {
# simple_filter = {
# label_filters = {
# application_name = [
# {
# operation = "IS"
# value = "nginx"
# },
# ]
# severities = ["Warning"]
# subsystem_name = [
# {
# operation = "IS"
# value = "subsystem-name"
# },
# ]
# }
# lucene_query = "mod_date:[20020101 TO 20030101]"
# }
# }
# denominator_alias = "denominator"
# group_by_for = "Both"
# notification_payload_filter = null
# numerator = {
# simple_filter = {
# label_filters = {
# application_name = [
# {
# operation = "IS"
# value = "nginx"
# },
# ]
# severities = ["Error"]
# subsystem_name = [
# {
# operation = "IS"
# value = "subsystem-name"
# },
# ]
# }
# lucene_query = "mod_date:[20030101 TO 20040101]"
# }
# }
# numerator_alias = "numerator"
# rules = [
# {
# condition = {
# condition_type = "MORE_THAN"
# threshold = 2
# time_window = {
# specific_value = "10_MINUTES"
# }
# }
# override = {
# priority = "P2"
# }
# },
# ]
# }
# logs_threshold = null
# logs_time_relative_threshold = null
# logs_unique_count = null
# metric_anomaly = null
# metric_threshold = null
# tracing_immediate = null
# tracing_threshold = null
# }
#}
#
## __generated__ by Terraform
#resource "coralogix_alert" "tracing_more_than" {
# deleted = false
# description = "Example of tracing_more_than alert from terraform"
# enabled = true
# group_by = null
# incidents_settings = {
# notify_on = "Triggered Only"
# retriggering_period = {
# minutes = 10
# }
# }
# labels = null
# name = "tracing_more_than alert example"
# notification_group = {
# group_by_keys = null
# webhooks_settings = null
# }
# phantom_mode = false
# priority = "P2"
# schedule = null
# type_definition = {
# flow = null
# logs_anomaly = null
# logs_immediate = null
# logs_new_value = null
# logs_ratio_threshold = null
# logs_threshold = null
# logs_time_relative_threshold = null
# logs_unique_count = null
# metric_anomaly = null
# metric_threshold = null
# tracing_immediate = null
# tracing_threshold = {
# notification_payload_filter = null
# rules = [
# {
# condition = {
# span_amount = 5
# time_window = {
# specific_value = "10_MINUTES"
# }
# }
# },
# ]
# tracing_filter = {
# latency_threshold_ms = 100
# tracing_label_filters = {
# application_name = [
# {
# operation = "IS"
# values = ["apache", "nginx"]
# },
# {
# operation = "STARTS_WITH"
# values = ["application-name:"]
# },
# ]
# operation_name = null
# service_name = null
# span_fields = null
# subsystem_name = null
# }
# }
# }
# }
#}
#