Skip to content

Latest commit

 

History

History
281 lines (189 loc) · 7.79 KB

events2metric.md

File metadata and controls

281 lines (189 loc) · 7.79 KB
page_title subcategory description
coralogix_events2metric Resource - terraform-provider-coralogix

coralogix_events2metric (Resource)

Example Usage

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_events2metric" "logs2metric" {
  name        = "logs2metricExample"
  description = "logs2metric from coralogix terraform provider"
  logs_query  = {
    lucene       = "remote_addr_enriched:/.*/"
    applications = ["filter:startsWith:nginx"] //change here for existing applications from your account
    severities   = ["Debug"]
  }

  metric_fields = {
    method = {
      source_field = "method"
    },
    geo_point = {
      source_field = "location_geopoint"
      aggregations = {
        max = {
          enable = false
        }
        min = {
          enable = false
        }
        avg = {
          enable = true
        }
      }
    }
  }

  metric_labels = {
    Status = "status"
    Path   = "http_referer"
  }

  permutations = {
    limit = 20000
  }
}

resource "coralogix_events2metric" "spans2metric" {
  name        = "spans2metricExample"
  description = "spans2metric from coralogix terraform provider"

  spans_query = {
    lucene       = "remote_addr_enriched:/.*/"
    applications = ["filter:startsWith:nginx"] //change here for existing applications from your account
    actions      = ["action-name"]
    services     = ["service-name"]
  }

  metric_fields = {
    method = {
      source_field = "method"
    },
    geo_point = {
      source_field = "location_geopoint"
      aggregations = {
        max = {
          enable = false
        }
        min = {
          enable = false
        }
        avg = {
          enable = true
        }
      }
    }
  }

  metric_labels = {
    Status = "status"
    Path   = "http_referer"
  }

  permutations = {
    limit = 20000
  }
}

Schema

Required

  • name (String) Events2Metric name. Events2Metric names have to be unique per account.

Optional

  • description (String) Events2Metric description.
  • logs_query (Attributes) logs-events2metric type. Exactly one of "spans_query" or "logs_query" must be defined. (see below for nested schema)
  • metric_fields (Attributes Map) (see below for nested schema)
  • metric_labels (Map of String)
  • permutations (Attributes) Defines the permutations' info of the events2metric. (see below for nested schema)
  • spans_query (Attributes) spans-events2metric type. Exactly one of "spans_query" or "logs_query" should be defined. (see below for nested schema)

Read-Only

  • id (String) The ID of this resource.

Nested Schema for logs_query

Optional:

  • applications (Set of String) An array that contains log’s application names that we want to be alerted on. Applications can be filtered by prefix, suffix, and contains using the next patterns - filter:startsWith:xxx, filter:endsWith:xxx, filter:contains:xxx
  • lucene (String) The search_query that we wanted to be notified on.
  • severities (Set of String) An array of severities that we interested in. Can be one of ["Critical" "Debug" "Error" "Info" "Unspecified" "Verbose" "Warning"]
  • subsystems (Set of String) An array that contains log’s subsystem names that we want to be notified on. Subsystems can be filtered by prefix, suffix, and contains using the next patterns - filter:startsWith:xxx, filter:endsWith:xxx, filter:contains:xxx

Nested Schema for metric_fields

Required:

  • source_field (String)

Optional:

Nested Schema for metric_fields.aggregations

Optional:

Nested Schema for metric_fields.aggregations.avg

Optional:

  • enable (Boolean)

Read-Only:

  • target_metric_name (String)

Nested Schema for metric_fields.aggregations.count

Optional:

  • enable (Boolean)

Read-Only:

  • target_metric_name (String)

Nested Schema for metric_fields.aggregations.histogram

Required:

  • buckets (List of Number)

Optional:

  • enable (Boolean)

Read-Only:

  • target_metric_name (String)

Nested Schema for metric_fields.aggregations.max

Optional:

  • enable (Boolean)

Read-Only:

  • target_metric_name (String)

Nested Schema for metric_fields.aggregations.min

Optional:

  • enable (Boolean)

Read-Only:

  • target_metric_name (String)

Nested Schema for metric_fields.aggregations.samples

Required:

  • type (String) Can be one of ["Max" "Min"].

Optional:

  • enable (Boolean)

Read-Only:

  • target_metric_name (String)

Nested Schema for metric_fields.aggregations.sum

Optional:

  • enable (Boolean)

Read-Only:

  • target_metric_name (String)

Nested Schema for permutations

Optional:

  • limit (Number) Defines the permutations' limit of the events2metric.

Read-Only:

  • has_exceed_limit (Boolean) Notify if the limit permutations' limit of the events2metric has exceed (computed).

Nested Schema for spans_query

Optional:

  • actions (Set of String) An array that contains log’s actions names that we want to be notified on. Actions can be filtered by prefix, suffix, and contains using the next patterns - filter:startsWith:xxx, filter:endsWith:xxx, filter:contains:xxx
  • applications (Set of String) An array that contains log’s application names that we want to be alerted on. Applications can be filtered by prefix, suffix, and contains using the next patterns - filter:startsWith:xxx, filter:endsWith:xxx, filter:contains:xxx
  • lucene (String) The search_query that we wanted to be notified on.
  • services (Set of String) An array that contains log’s services names that we want to be notified on. Services can be filtered by prefix, suffix, and contains using the next patterns - filter:startsWith:xxx, filter:endsWith:xxx, filter:contains:xxx
  • subsystems (Set of String) An array that contains log’s subsystem names that we want to be notified on. Subsystems can be filtered by prefix, suffix, and contains using the next patterns - filter:startsWith:xxx, filter:endsWith:xxx, filter:contains:xxx