From afd3a86278c8a5f3f868175048be1dd9ad6a8c62 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 2 Aug 2017 18:12:17 +0100 Subject: [PATCH] [Fix] Fix pushing country to clickhouse asn table --- src/plugins/lua/clickhouse.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.47.3