fix: 修复无法读取ssh成功日志 (#1356)

Co-authored-by: 凹凸曼 <xx@xx>
This commit is contained in:
凹凸曼 2023-06-13 10:26:39 +08:00 committed by GitHub
parent fd5b34d644
commit 68ad653545
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -248,7 +248,7 @@ func (u *SSHService) LoadLog(req dto.SearchSSHLog) (*dto.SSHLog, error) {
data.Logs = append(data.Logs, dataItem...) data.Logs = append(data.Logs, dataItem...)
} }
} }
commandItem := fmt.Sprintf("cat %s | grep Accepted %s", fileList[i], command) commandItem := fmt.Sprintf("cat %s | grep -a Accepted %s", fileList[i], command)
dataItem := loadSuccessDatas(commandItem) dataItem := loadSuccessDatas(commandItem)
data.TotalCount += len(dataItem) data.TotalCount += len(dataItem)
if req.Status != constant.StatusFailed { if req.Status != constant.StatusFailed {