From babeb8beaa4560f0a273cc193d739df05b94db49 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 23 Apr 2019 15:28:19 +0100 Subject: [PATCH] [Fix] Fix issue with urls with no tld (e.g. IP) --- src/plugins/lua/clickhouse.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua index afdc2f0aa..7482da01e 100644 --- a/src/plugins/lua/clickhouse.lua +++ b/src/plugins/lua/clickhouse.lua @@ -674,7 +674,9 @@ local function clickhouse_collect(task) end -- Get tlds - table.insert(row, flatten_urls(function(_,u) return u:get_tld() end, urls_urls)) + table.insert(row, flatten_urls(function(_, u) + return u:get_tld() or u:get_host() + end, urls_urls)) -- Get hosts/full urls table.insert(row, flatten_urls(function(k, _) return k end, urls_urls)) else -- 2.39.5