From: Vsevolod Stakhov Date: Thu, 23 Apr 2020 15:13:26 +0000 (+0100) Subject: [Minor] Selectors: Add scan_result extractor X-Git-Tag: 2.6~494 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=86c11386cf43e7b841a8673d2552913084bbd406;p=rspamd.git [Minor] Selectors: Add scan_result extractor --- 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