diff --git a/modules/logpush-job/main.tf b/modules/logpush-job/main.tf index a3ae209..203350a 100644 --- a/modules/logpush-job/main.tf +++ b/modules/logpush-job/main.tf @@ -102,9 +102,12 @@ resource "cloudflare_logpush_job" "crx-logpush-zone" { destination_conf = var.coralogix_subsystem_name != "" || var.coralogix_application_name != "" ? "https://${local.coralogix_regions[var.coralogix_region]}/api/v1/cloudflare/logs?header_Authorization=Bearer%20${var.coralogix_private_key}&header_CX-Application-Name=${var.coralogix_application_name}&header_CX-Subsystem-Name=${var.coralogix_subsystem_name}&header_timestamp-format=UnixNano&header_dataset=${local.coralogix_dataset[var.cloudflare_logpush_dataset]}&tags=dataset:${var.cloudflare_logpush_dataset}" : "https://${local.coralogix_regions[var.coralogix_region]}/api/v1/cloudflare/logs?header_Authorization=Bearer%20${var.coralogix_private_key}&header_timestamp-format=UnixNano&header_dataset=${local.coralogix_dataset[var.cloudflare_logpush_dataset]}&tags=dataset:${var.cloudflare_logpush_dataset}" dataset = var.cloudflare_logpush_dataset frequency = "low" - filter = "" + filter = var.cloudflare_zone_filter ownership_challenge = "" kind = "" + output_options { + sample_rate = var.cloudflare_zone_sample_rate + } lifecycle { } } @@ -118,9 +121,12 @@ resource "cloudflare_logpush_job" "crx-logpush-account" { destination_conf = var.coralogix_subsystem_name != "" || var.coralogix_application_name != "" ? "https://${local.coralogix_regions[var.coralogix_region]}/api/v1/cloudflare/logs?header_Authorization=Bearer%20${var.coralogix_private_key}&header_CX-Application-Name=${var.coralogix_application_name}&header_CX-Subsystem-Name=${var.coralogix_subsystem_name}&header_timestamp-format=UnixNano&header_dataset=${local.coralogix_dataset[var.cloudflare_logpush_dataset]}&tags=dataset:${var.cloudflare_logpush_dataset}" : "https://${local.coralogix_regions[var.coralogix_region]}/api/v1/cloudflare/logs?header_Authorization=Bearer%20${var.coralogix_private_key}&header_timestamp-format=UnixNano&header_dataset=${local.coralogix_dataset[var.cloudflare_logpush_dataset]}&tags=dataset:${var.cloudflare_logpush_dataset}" dataset = var.cloudflare_logpush_dataset frequency = "low" - filter = "" + filter = var.cloudflare_account_filter ownership_challenge = "" kind = "" + output_options { + sample_rate = var.cloudflare_account_sample_rate + } lifecycle { } } diff --git a/modules/logpush-job/variables.tf b/modules/logpush-job/variables.tf index 8c6b723..834deb2 100644 --- a/modules/logpush-job/variables.tf +++ b/modules/logpush-job/variables.tf @@ -54,3 +54,27 @@ variable "coralogix_subsystem_name" { sensitive = true default = "" } + +variable "cloudflare_account_filter" { + description = "value to filter the account logs" + type = string + default = "" +} + +variable "cloudflare_zone_filter" { + description = "value to filter the zone logs" + type = string + default = "" +} + +variable "cloudflare_account_sample_rate" { + description = "The sample rate for account based data-sets" + type = number + default = 1 +} + +variable "cloudflare_zone_sample_rate" { + description = "The sample rate for zone based data-sets" + type = number + default = 1 +}