http_params.no_ssl_verify = settings.no_ssl_verify
http_params.user = settings.user
http_params.password = settings.password
+ http_params.method = 'POST'
http_params.body = {table.concat(fun.totable(fun.map(function(row)
return row_to_tsv(row)
- end), rows), '\n'), '\n'}
+ end, rows)), '\n'), '\n'}
http_params.log_obj = params.task or params.config
if not http_params.url then
'ListId',
'Digest'
}
- local elt = string.format('INSERT INTO %s (%s) VALUES ',
+ local elt = string.format('INSERT INTO %s (%s) ',
tname, table.concat(fields, ','))
return elt
'Attachments.Length',
'Attachments.Digest',
}
- local elt = string.format('INSERT INTO %s (%s) VALUES ',
+ local elt = string.format('INSERT INTO %s (%s) ',
tname, table.concat(attachement_fields, ','))
return elt
end
'Urls.Tld',
'Urls.Url',
}
- local elt = string.format('INSERT INTO %s (%s) VALUES ',
+ local elt = string.format('INSERT INTO %s (%s) ',
tname, table.concat(urls_fields, ','))
return elt
end
'Digest',
'Emails',
}
- local elt = string.format('INSERT INTO %s (%s) VALUES ',
+ local elt = string.format('INSERT INTO %s (%s) ',
tname, table.concat(emails_fields, ','))
return elt
end
'Symbols.Scores',
'Symbols.Options',
}
- local elt = string.format('INSERT INTO %s (%s) VALUES ',
+ local elt = string.format('INSERT INTO %s (%s) ',
tname, table.concat(symbols_fields, ','))
return elt
end
'Country',
'IPNet',
}
- local elt = string.format('INSERT INTO %s (%s) VALUES ',
+ local elt = string.format('INSERT INTO %s (%s) ',
tname, table.concat(asn_fields, ','))
return elt
end
local ch_params = {
task = task,
}
+
local ret = lua_clickhouse.insert(upstream, settings, ch_params,
query, tbl,
gen_success_cb(what, #tbl),
end
nrows = nrows + 1
+ rspamd_logger.debugm(N, task, "add clickhouse row %s / %s", nrows, settings.limit)
if nrows > settings['limit'] then
clickhouse_send_data(task)