Skip to content

Commit

Permalink
add output sample_rate & filter (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantanjunming authored Jul 23, 2024
1 parent 2f699ec commit 62f1dfd
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
10 changes: 8 additions & 2 deletions modules/logpush-job/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
}
}
Expand All @@ -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 {
}
}
24 changes: 24 additions & 0 deletions modules/logpush-job/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 62f1dfd

Please sign in to comment.