diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-31 22:36:29 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-31 22:36:29 +0000 |
commit | 4ea06f2591ccf116b201ca70b25d3d5e019d7a0e (patch) | |
tree | fcb5061b161d7ff3025b63f21ec08820f10ac669 | |
parent | a3f746d902aec4215a8d759be8cd43b987fed46a (diff) | |
download | rspamd-4ea06f2591ccf116b201ca70b25d3d5e019d7a0e.tar.gz rspamd-4ea06f2591ccf116b201ca70b25d3d5e019d7a0e.zip |
[Fix] Restore URLs exporting in ClickHouse plugin
-rw-r--r-- | src/plugins/lua/clickhouse.lua | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/lua/clickhouse.lua b/src/plugins/lua/clickhouse.lua index 556de40ef..87ae8dff6 100644 --- a/src/plugins/lua/clickhouse.lua +++ b/src/plugins/lua/clickhouse.lua @@ -489,10 +489,15 @@ local function clickhouse_collect(task) table.insert(row, {}) end + local flatten_urls = function(...) + return fun.totable(fun.map(function(k,_) return k end, ...)) + end + -- Urls step local urls_tlds = {} local urls_urls = {} if task:has_urls(false) then + for _,u in ipairs(task:get_urls(false)) do urls_tlds[u:get_tld()] = true if settings['full_urls'] then @@ -501,13 +506,7 @@ local function clickhouse_collect(task) urls_urls[u:get_host()] = true end end - end - - local flatten_urls = function(...) - return fun.totable(fun.map(function(k,_) return k end, ...)) - end - if #urls_tlds > 0 then table.insert(row, flatten_urls(urls_tlds)) table.insert(row, flatten_urls(urls_urls)) else |