From 23a9b6e1b03f801e61f475cc8ce1ff24043f6ec9 Mon Sep 17 00:00:00 2001 From: Mark Stemm Date: Tue, 23 Aug 2016 14:15:52 -0700 Subject: [PATCH] Fix output methods that take configurations. The falco engine changes broke the output methods that take configuration (like the filename for file output, or the program for program output). Fix that by properly passing the options argument to each method's output function. --- userspace/falco/lua/output.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/userspace/falco/lua/output.lua b/userspace/falco/lua/output.lua index 158d7fbc..1ff631ab 100644 --- a/userspace/falco/lua/output.lua +++ b/userspace/falco/lua/output.lua @@ -23,17 +23,17 @@ function mod.file_validate(options) end -function mod.file(level, msg) +function mod.file(level, msg, options) file = io.open(options.filename, "a+") file:write(msg, "\n") file:close() end -function mod.syslog(level, msg) +function mod.syslog(level, msg, options) falco.syslog(level, msg) end -function mod.program(level, msg) +function mod.program(level, msg, options) -- XXX Ideally we'd check that the program ran -- successfully. However, the luajit we're using returns true even -- when the shell can't run the program. @@ -61,7 +61,7 @@ function output_event(event, rule, priority, format) msg = falco.format_event(event, rule, levels[level+1], formatter) for index,o in ipairs(outputs) do - o.output(level, msg) + o.output(level, msg, o.config) end falco.free_formatter(formatter)