diff options
Diffstat (limited to 'src/plugins/lua/elastic.lua')
-rw-r--r-- | src/plugins/lua/elastic.lua | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/lua/elastic.lua b/src/plugins/lua/elastic.lua index 03462f9eb..18cc0ea09 100644 --- a/src/plugins/lua/elastic.lua +++ b/src/plugins/lua/elastic.lua @@ -53,6 +53,7 @@ local settings = { password = nil, no_ssl_verify = false, max_fail = 3, + ingest_module = false, } local function read_file(path) @@ -234,8 +235,7 @@ local opts = rspamd_config:get_all_opt('elastic') local function check_elastic_server(cfg, ev_base, _) local upstream = settings.upstream:get_upstream_round_robin() local ip_addr = upstream:get_addr():to_string(true) - - local plugins_url = connect_prefix .. ip_addr .. '/_nodes/plugins' + local plugins_url = connect_prefix .. ip_addr .. '/_nodes/' .. ingest_geoip_type local function http_callback(err, code, body, _) if code == 200 then local parser = ucl.parser() @@ -446,6 +446,12 @@ if redis_params and opts then connect_prefix = 'https://' end + if settings.ingest_module then + ingest_geoip_type = 'modules' + else + ingest_geoip_type = 'plugins' + end + settings.upstream = upstream_list.create(rspamd_config, settings['server'] or settings['servers'], 9200) |