openvpn-install
openvpn-install copied to clipboard
Shows only 'user' successful authentication in logs
I have run the command :
cat openvpn.log | grep -i "Username/Password authentication succeeded for username"
and this is the result :
Fri Aug 7 05:28:00 2020 zagar/127.0.0.1:34276 TLS: Username/Password authentication succeeded for username 'zagar' [CN SET]
Fri Aug 7 05:31:28 2020 127.0.0.1:37616 TLS: Username/Password authentication succeeded for username 'agungcendol' [CN SET]
Fri Aug 7 05:31:54 2020 ulum/127.0.0.1:34408 TLS: Username/Password authentication succeeded for username 'ulum' [CN SET]
Fri Aug 7 05:35:36 2020 127.0.0.1:37928 TLS: Username/Password authentication succeeded for username 'vidia' [CN SET]
Fri Aug 7 05:38:06 2020 127.0.0.1:38092 TLS: Username/Password authentication succeeded for username 'erji' [CN SET]
Fri Aug 7 05:38:49 2020 127.0.0.1:38156 TLS: Username/Password authentication succeeded for username 'hadijah' [CN SET]
how can i get only the 'user_name' result in the bash command?
That works for me:
➜ ~ cat openvpn.log | grep -i "Username/Password authentication succeeded for username" | cut -f 2 -d "'"
zagar
agungcendol
ulum
vidia
erji
hadijah
That works for me:
➜ ~ cat openvpn.log | grep -i "Username/Password authentication succeeded for username" | cut -f 2 -d "'" zagar agungcendol ulum vidia erji hadijah
I tried, but it doesn't work.
cat /etc/openvpn/openvpn.log | grep -i "Username/Password authentication succeeded for username" | cut -f 2 -d "'"
Binary file (standard input) matches
/var/log/openvpn/status.log location ?