(dateStr string)
| 1444 | } |
| 1445 | |
| 1446 | func normalizeSSHLogDate(dateStr string) string { |
| 1447 | if t, err := time.Parse(time.RFC3339Nano, dateStr); err == nil { |
| 1448 | return t.Format("2006 Jan 2 15:04:05") |
| 1449 | } |
| 1450 | if t, err := time.Parse(constant.DateTimeLayout, dateStr); err == nil { |
| 1451 | return t.Format("2006 Jan 2 15:04:05") |
| 1452 | } |
| 1453 | if _, err := time.Parse("Jan 2 15:04:05", dateStr); err == nil { |
| 1454 | return dateStr |
| 1455 | } |
| 1456 | return "" |
| 1457 | } |
| 1458 | |
| 1459 | func parseSSHLogMessage(message string) (dto.SSHHistory, bool) { |
| 1460 | if matches := re.GetRegex(re.SSHAcceptedPattern).FindStringSubmatch(message); len(matches) == 5 { |
no test coverage detected