在我制作的这行代码上使用的最佳循环是什么,它通过日志文件并找到失败的行$6
?对 BASH 和 LINUX 来说非常新鲜,无法让任何循环正常工作。
Sep 13 12:09:39 icarus sshd[14043]: Failed none for invalid user 55659
Sep 13 12:09:43 icarus sshd[14043]: pam_unix(sshd:auth): check pass; user unknown
Sep 13 12:09:43 icarus sshd[14043]: pam_unix(sshd:auth):
Sep 13 12:09:44 icarus sshd[14043]: Failed password for invalid user 55659
Sep 13 12:09:48 icarus sshd[14043]: pam_unix(sshd:auth): check pass; user unknown
Sep 13 12:09:50 icarus sshd[14043]: Failed password for invalid user 55659 from
示例命令
cat auth.log | sed -e 's/,//g' | awk -F" " '{print $6}'