From 2a1a47457bd6e30fcdcea7abe88423504889d835 Mon Sep 17 00:00:00 2001 From: Duncan Martin Walker Date: Fri, 5 Jun 2020 10:21:40 +0100 Subject: [PATCH] Allow Logstash node.name override The node.name Logstash config variable is currently hard coded to inventory_hostname in the elastic_logstash role. This commit exposes the option to modify this, which allows Logstash to be identified under a more readable name in e.g. Kibana. The default behaviour is unchanged. Change-Id: Ic3b21d54c9759117550cc85bade3dc7900d0f502 --- elk_metrics_7x/roles/elastic_logstash/defaults/main.yml | 3 +++ .../roles/elastic_logstash/templates/logstash.yml.j2 | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/elk_metrics_7x/roles/elastic_logstash/defaults/main.yml b/elk_metrics_7x/roles/elastic_logstash/defaults/main.yml index 92a00fbf..3ddc4d41 100644 --- a/elk_metrics_7x/roles/elastic_logstash/defaults/main.yml +++ b/elk_metrics_7x/roles/elastic_logstash/defaults/main.yml @@ -102,3 +102,6 @@ logstash_collectd_buffer_size: 1452 logstash_collectd_security_level: Sign # To enable security the auth file is required. #logstash_collectd_authfile: /etc/collectd/passwd + +# Set the descriptive name by which Logstash is identified +logstash_node_name: "{{ inventory_hostname }}" diff --git a/elk_metrics_7x/roles/elastic_logstash/templates/logstash.yml.j2 b/elk_metrics_7x/roles/elastic_logstash/templates/logstash.yml.j2 index 8642f536..9e14c7a4 100644 --- a/elk_metrics_7x/roles/elastic_logstash/templates/logstash.yml.j2 +++ b/elk_metrics_7x/roles/elastic_logstash/templates/logstash.yml.j2 @@ -16,7 +16,7 @@ # # Use a descriptive name for the node: # -node.name: {{ inventory_hostname }} +node.name: {{ logstash_node_name }} # # If omitted the node name will default to the machine's host name #