diff options
author | Mika Havela <mika.havela@gmail.com> | 2007-12-31 16:45:10 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2007-12-31 16:45:10 +0000 |
commit | c9c5687ee9d596414a940e627cfbed3d98e960ca (patch) | |
tree | 9d8ca19fce01108591b49ab2985aa8390182e4f9 /snort-model.lua | |
parent | 14bea207755931df0155fa9a577782aa167695be (diff) | |
download | acf-snort-c9c5687ee9d596414a940e627cfbed3d98e960ca.tar.bz2 acf-snort-c9c5687ee9d596414a940e627cfbed3d98e960ca.tar.xz |
Sorting alert-output based on priority
git-svn-id: svn://svn.alpinelinux.org/acf/snort/trunk@479 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'snort-model.lua')
-rw-r--r-- | snort-model.lua | 9 |
1 files changed, 8 insertions, 1 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 |