From c9c5687ee9d596414a940e627cfbed3d98e960ca Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Mon, 31 Dec 2007 16:45:10 +0000 Subject: Sorting alert-output based on priority git-svn-id: svn://svn.alpinelinux.org/acf/snort/trunk@479 ab2d0c66-481e-0410-8bed-d214d4d58bed --- snort-model.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'snort-model.lua') diff --git a/snort-model.lua b/snort-model.lua index da6d803..b4b3266 100644 --- a/snort-model.lua +++ b/snort-model.lua @@ -108,6 +108,13 @@ read_alert = function () end end end - return alertcount,alertpriority + --Start sorting priority-table + local sorted_table = {} + for n in pairs(alertpriority) do + table.insert(sorted_table, {name=n, value=alertpriority[n]}) + end + table.sort(sorted_table, function(a,b) return (a.name < b.name) end) + + return alertcount,sorted_table end -- cgit v1.2.3