From 175c584e6805edb4a60aa15b673344ec98d13f42 Mon Sep 17 00:00:00 2001 From: ol3k Date: Thu, 27 Jun 2019 20:28:22 +0200 Subject: [PATCH] Update elastic.lua --- src/plugins/lua/elastic.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/lua/elastic.lua b/src/plugins/lua/elastic.lua index 98ac7989c..f0d339205 100644 --- a/src/plugins/lua/elastic.lua +++ b/src/plugins/lua/elastic.lua @@ -34,6 +34,7 @@ local elastic_template local redis_params local N = "elastic" local E = {} +local HOSTNAME = util.get_hostname() local connect_prefix = 'http://' local enabled = true local ingest_geoip_type = 'plugins' @@ -146,7 +147,7 @@ local function get_general_metadata(task) r.user = task:get_user() or 'unknown' r.qid = task:get_queue_id() or 'unknown' r.action = task:get_metric_action('default') - r.rspamd_server = util.get_hostname() or 'unknown' + r.rspamd_server = HOSTNAME if r.user ~= 'unknown' then r.direction = "Outbound" end -- 2.39.5