diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-31 17:23:39 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-05-31 17:23:39 +0100 |
commit | b45bc487b77ad51e3cf25ad9f0b19334c821cc6f (patch) | |
tree | 1d0c1e95c57bd61ee1a83358a4df1d94f0cc066b /src/plugins/lua/elastic.lua | |
parent | 98763319d1169ede18cb0470672cc7acb8f0d679 (diff) | |
download | rspamd-b45bc487b77ad51e3cf25ad9f0b19334c821cc6f.tar.gz rspamd-b45bc487b77ad51e3cf25ad9f0b19334c821cc6f.zip |
[Feature] Add gzip compression for HTTP requests in elastic module
Diffstat (limited to 'src/plugins/lua/elastic.lua')
-rw-r--r-- | src/plugins/lua/elastic.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/lua/elastic.lua b/src/plugins/lua/elastic.lua index 4caedd684..3a80256d2 100644 --- a/src/plugins/lua/elastic.lua +++ b/src/plugins/lua/elastic.lua @@ -46,6 +46,7 @@ local settings = { failover = false, import_kibana = false, use_https = false, + use_gzip = true, allow_local = false, } @@ -106,6 +107,7 @@ local function elastic_send_data(task) body = bulk_json, task = task, method = 'post', + gzip = settings.use_gzip, callback = http_index_data_callback }) @@ -305,6 +307,7 @@ local function initial_setup(cfg, ev_base, worker) }, body = table.concat(tbl, "\n"), method = 'post', + gzip = settings.use_gzip, callback = kibana_template_callback }) else @@ -341,6 +344,7 @@ local function initial_setup(cfg, ev_base, worker) headers = { ['Content-Type'] = 'application/json', }, + gzip = settings.use_gzip, body = ucl.to_format(template, 'json-compact'), method = 'put', }) @@ -366,6 +370,7 @@ local function initial_setup(cfg, ev_base, worker) headers = { ['Content-Type'] = 'application/json', }, + gzip = settings.use_gzip, callback = http_template_put_callback, }) else |