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

Function parseSSHLogHeader

agent/app/service/ssh.go:1418–1431  ·  view source on GitHub ↗
(line string)

Source from the content-addressed store, hash-verified

1416}
1417
1418func parseSSHLogHeader(line string) (sshLogHeader, bool) {
1419 for _, pattern := range []string{re.SSHRFC3339LinePattern, re.SSHDateTimeLinePattern, re.SSHSyslogLinePattern} {
1420 matches := re.GetRegex(pattern).FindStringSubmatch(line)
1421 if len(matches) != 5 {
1422 continue
1423 }
1424 dateStr := normalizeSSHLogDate(matches[1])
1425 if dateStr == "" {
1426 return sshLogHeader{}, false
1427 }
1428 return sshLogHeader{DateStr: dateStr, Process: matches[2], PID: matches[3], Message: matches[4]}, true
1429 }
1430 return sshLogHeader{}, false
1431}
1432
1433func loadSSHLogSessionKey(header sshLogHeader, data dto.SSHHistory, line string) string {
1434 if header.Process == "sshd-session" && data.Address != "" && data.Port != "" {

Callers 1

parseSSHLogLineFunction · 0.85

Calls 1

normalizeSSHLogDateFunction · 0.85

Tested by

no test coverage detected