Skip to content

Commit

Permalink
feat: Splunk _env (#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
haroldjimenez authored Jan 14, 2025
1 parent ba72432 commit bc80a7d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [7.9.1] - 2025-01-14
### Added
- Added Splunk env for segrigatting logs for each environment.

## [7.9.0] - 2025-01-09
### Added
- Enabled Splunk for log forwarding and implemented health checks for ECS HMS.
Expand Down
3 changes: 3 additions & 0 deletions templates.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ locals{
splunk_hec_host = var.splunk_hec_host
splunk_hec_token = var.splunk_hec_token
splunk_hec_index = var.splunk_hec_index
splunk_env = var.splunk_env
})

hms_readonly_template = templatefile("${path.module}/templates/apiary-hms-readonly.json", {
Expand Down Expand Up @@ -143,5 +144,7 @@ locals{
splunk_hec_host = var.splunk_hec_host
splunk_hec_token = var.splunk_hec_token
splunk_hec_index = var.splunk_hec_index
splunk_env = var.splunk_env

})
}
2 changes: 1 addition & 1 deletion templates/apiary-hms-readonly.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
jsonencode({
"splunk-token": "${splunk_hec_token}",
"splunk-url": "${splunk_hec_host}",
"splunk-source": "apiary-hms-readonly-logs",
"splunk-source": "apiary-hms-readonly-logs${splunk_env}",
"splunk-sourcetype": "hms-logs",
"splunk-index": "${splunk_hec_index}"
}) :
Expand Down
2 changes: 1 addition & 1 deletion templates/apiary-hms-readwrite.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
jsonencode({
"splunk-token": "${splunk_hec_token}",
"splunk-url": "${splunk_hec_host}",
"splunk-source": "apiary-hms-readwrite-logs",
"splunk-source": "apiary-hms-readwrite-logs${splunk_env}",
"splunk-sourcetype": "hms-logs",
"splunk-index": "${splunk_hec_index}"
}) :
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1149,3 +1149,8 @@ variable "splunk_hec_index" {
default = ""
}

variable "splunk_env" {
description = "Environment in which the Splunk server is sending logs from."
type = string
default = ""
}

0 comments on commit bc80a7d

Please sign in to comment.