MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / normalizeSSHLogDate

Function normalizeSSHLogDate

agent/app/service/ssh.go:1446–1457  ·  view source on GitHub ↗
(dateStr string)

Source from the content-addressed store, hash-verified

1444}
1445
1446func 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
1459func parseSSHLogMessage(message string) (dto.SSHHistory, bool) {
1460 if matches := re.GetRegex(re.SSHAcceptedPattern).FindStringSubmatch(message); len(matches) == 5 {

Callers 1

parseSSHLogHeaderFunction · 0.85

Calls 2

ParseMethod · 0.80
FormatMethod · 0.45

Tested by

no test coverage detected