From: ol3k Date: Thu, 27 Jun 2019 18:28:22 +0000 (+0200) Subject: Update elastic.lua X-Git-Tag: 2.0~707^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2949%2Fhead;p=thirdparty%2Frspamd.git Update elastic.lua --- diff --git a/src/plugins/lua/elastic.lua b/src/plugins/lua/elastic.lua index 98ac7989cd..f0d339205d 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