aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-23 16:13:26 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-23 16:13:26 +0100
commit86c11386cf43e7b841a8673d2552913084bbd406 (patch)
tree36b5a47ada673dd620bbba87a541e34d809e78ae /lualib
parente6556d52c29bc350b20bea5480726eb98c460639 (diff)
downloadrspamd-86c11386cf43e7b841a8673d2552913084bbd406.tar.gz
rspamd-86c11386cf43e7b841a8673d2552913084bbd406.zip
[Minor] Selectors: Add scan_result extractor
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_selectors/extractors.lua14
1 files changed, 12 insertions, 2 deletions
diff --git a/lualib/lua_selectors/extractors.lua b/lualib/lua_selectors/extractors.lua
index c40b93b3b..6e023c780 100644
--- a/lualib/lua_selectors/extractors.lua
+++ b/lualib/lua_selectors/extractors.lua
@@ -428,8 +428,18 @@ The first argument must be header name.]],
'Returns the symbol table. See task:get_symbol()',
['args_schema'] = {ts.string, ts.string:is_optional()}
},
-
-
+ -- Get full scan result
+ ['scan_result'] = {
+ ['get_value'] = function(task, args)
+ local res = task:get_metric_result(args[1])
+ if res then
+ return res,'table'
+ end
+ end,
+ ['description'] = 'Get full scan result (either default or shadow if shadow result name is specified)' ..
+ 'Returns the result table. See task:get_metric_result()',
+ ['args_schema'] = {ts.string:is_optional()}
+ },
}
return extractors