diff --git a/bin/collect_login_data.sh b/bin/collect_login_data.sh index 0a5e1ce..de8bc24 100755 --- a/bin/collect_login_data.sh +++ b/bin/collect_login_data.sh @@ -61,7 +61,8 @@ function parseLog() if [ "${logger}" = "systemd" ]; then # 2022-11-18T20:04:08+0900 auth_date=$(echo "${line}" | cut -d " " -f 1); - auth_user=$(echo "${line}" | cut -d "]" -f 2 | cut -d " " -f 7 | cut -d "." -f 1); + # Note, instead of cut with dot, remove last dot in line + auth_user=$(echo "${line}" | cut -d "]" -f 2 | cut -d " " -f 7 | sed -e "s/\.$//"); else auth_date=$(echo "${line}" | cut -c 1-6)" ${start_year} "$(echo "${line}" | cut -c 8-15); auth_user=$(echo "${line}" | cut -d ")" -f 2 | cut -d " " -f 6 | cut -d "(" -f 1);