]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Allow local messages to be exported to elasticsearch
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 9 Mar 2018 11:55:02 +0000 (11:55 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 9 Mar 2018 11:55:02 +0000 (11:55 +0000)
src/plugins/lua/elastic.lua

index dfe8ce84c3a9d990248db93b03cc87002cf4def7..a344a4bb71e67a0894fccabf7fccfc53ad328528 100644 (file)
@@ -46,6 +46,7 @@ local settings = {
   failover = false,
   import_kibana = false,
   use_https = false,
+  allow_local = false,
 }
 
 local function read_file(path)
@@ -183,7 +184,7 @@ end
 
 local function elastic_collect(task)
   if not enabled then return end
-  if rspamd_lua_utils.is_rspamc_or_controller(task) then return end
+  if not settings.allow_local and rspamd_lua_utils.is_rspamc_or_controller(task) then return end
   local row = {['rspamd_meta'] = get_general_metadata(task),
     ['@timestamp'] = tostring(util.get_time() * 1000)}
   table.insert(rows, row)