Skip to content

Commit 6586f9b

Browse files
author
Dmitry Berezovsky
committed
Fixed syslog config
1 parent a14399b commit 6586f9b

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

modules/elasticsearch/ec2.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ write_files:
3232
ECS_AVAILABLE_LOGGING_DRIVERS=["json-file","syslog","journald","gelf","awslogs"]
3333
- path: /etc/sysctl.d/01-elasticsearch.conf
3434
content: |
35-
vm.max_map_count = 262144
35+
:syslogtag, startswith, "${var.syslog_tag_prefix}" /var/log/${var.docker_log_file_name}
3636
runcmd:
3737
- [ cloud-init-per, once, "install-unix-tools", "install-unix-tools", "-t", "1.0", "full"]
38-
- [ cloud-init-per, once, "set-hostname", "aws-set-hostname", "${lower(var.verbose_name)}graylog-elasticsearch-{count.index}", "-s"]
38+
- [ cloud-init-per, once, "set-hostname", "aws-set-hostname", "${lower(var.verbose_name)}-elasticsearch-{count.index}", "-s"]
3939
- [ cloud-init-per, once, "read-custom-syslog", "sysctl", "-p", "/etc/sysctl.d/01-elasticsearch.conf"]
4040
- [ cloud-init-per, once, "docker-stop", "service", "docker", "stop"]
4141
- [ cloud-init-per, once, "mount-ebs", "mount-ebs", "${var.data_volume_device}", "${var.data_volume_path}", "0777" ]

modules/elasticsearch/variables.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,11 @@ variable "elasticsearch_version" {
9494
type = "string"
9595
default = "5.2.2"
9696
}
97+
98+
variable "docker_log_file_name" {
99+
default = "docker-app.log"
100+
}
101+
102+
variable "syslog_tag_prefix" {
103+
default = "elasticsearch"
104+
}

0 commit comments

Comments
 (0)