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 ++++++++- snort-read-html.lsp | 16 ++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) 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 diff --git a/snort-read-html.lsp b/snort-read-html.lsp index afda1fa..9bc3b14 100644 --- a/snort-read-html.lsp +++ b/snort-read-html.lsp @@ -19,16 +19,16 @@
Status
alert(s)
- -

- + +

+

- -


- -
+ +


+ +
- (This alarm is repeated times)

+ (This alarm is repeated times)

-- cgit v1.2.3