Allow missing output fields.

Add a leading * to the format string so output with missing fields is
just displayed with '<NA>' values instead of being aborted.

This fixes #42.
This commit is contained in:
Mark Stemm 2016-05-08 14:27:08 -07:00
parent fda5162061
commit 594d3d66d5

View File

@ -5,7 +5,7 @@ levels = {"Emergency", "Alert", "Critical", "Error", "Warning", "Notice", "Infor
local outputs = {}
function mod.stdout(evt, level, format)
format = "%evt.time: "..levels[level+1].." "..format
format = "*%evt.time: "..levels[level+1].." "..format
formatter = falco.formatter(format)
msg = falco.format_event(evt, formatter)
print (msg)