Support TXT uploads and extend XigmaNAS event parsing
This commit is contained in:
1 parent
ae588ae75a
commit
92134a6cc1
6 files changed
+296
-5
No files matched your search
+22
@@ -91,4 +91,26 @@ func TestParserParseExample(t *testing.T) {
|
||||
if len(result.Events) == 0 {
|
||||
t.Fatal("expected events from uptime/zfs sections")
|
||||
}
|
||||
|
||||
var hasSystemLog, hasSmartdLog, hasDaemonLog, hasLoginFailure bool
|
||||
for _, ev := range result.Events {
|
||||
if ev.EventType == "System Log" {
|
||||
hasSystemLog = true
|
||||
}
|
||||
if ev.EventType == "SMARTD Log" {
|
||||
hasSmartdLog = true
|
||||
}
|
||||
if ev.EventType == "Daemon Log" {
|
||||
hasDaemonLog = true
|
||||
}
|
||||
if strings.Contains(strings.ToLower(ev.Description), "login failure") {
|
||||
hasLoginFailure = true
|
||||
}
|
||||
}
|
||||
if !hasSystemLog || !hasSmartdLog || !hasDaemonLog {
|
||||
t.Fatalf("expected events from System/SMARTD/Daemon sections, got system=%v smartd=%v daemon=%v", hasSystemLog, hasSmartdLog, hasDaemonLog)
|
||||
}
|
||||
if !hasLoginFailure {
|
||||
t.Fatal("expected to parse login failure event from system log section")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user