From: Vsevolod Stakhov Date: Wed, 2 Aug 2017 17:12:17 +0000 (+0100) Subject: [Fix] Fix pushing country to clickhouse asn table X-Git-Tag: 1.7.0~772 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afd3a86278c8a5f3f868175048be1dd9ad6a8c62;p=thirdparty%2Frspamd.git [Fix] Fix pushing country to clickhouse asn table --- diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua index 3af60a7a06..08fb25c8c3 100644 --- a/src/plugins/lua/clickhouse.lua +++ b/src/plugins/lua/clickhouse.lua @@ -573,7 +573,7 @@ local function clickhouse_collect(task) -- ASN information if settings['asn_table'] then - local asn, country, ipnet = 'unknown', 'unknown', 'unknown' + local asn, country, ipnet = 'UN', 'UN', 'UN' local pool = task:get_mempool() ret = pool:get_variable("asn") if ret then @@ -581,7 +581,7 @@ local function clickhouse_collect(task) end ret = pool:get_variable("country") if ret then - country = ret + country = ret:sub(1, 2) end ret = pool:get_variable("ipnet") if ret then