Answer the question
In order to leave comments, you need to log in
How to parse the log?
Hello. Help parse the log
There is a status log from openVPN like this.
ivanov.as,IP_addres,56924339,46404603,Thu Apr 16
07:20:32
2020
16 08:08:04 2020
Bash or regular expressions need to read the presence of a user for example ivanov.as every minute and write to another log like ivanov.as 1, after a minute read the log again and if the user is there, increase the counter by one
PS I understand that the solution can be a crutch, I don’t know how else to take into account the connection time of users to the OpenVPN server.
Thanks in advance to everyone who replied.
Answer the question
In order to leave comments, you need to log in
cut -d, -f2
111.txt
where
the -d
separator
is
a ","
-f
column it remains for you to cut it as you need
here you will receive online all the lines about this comrade,
then you can count them
tail -f /var/log/syslog | grep -o "ivanov.as"
tail -f /var/log/syslog | grep -o "ivanov.as" | wc -l > ivanov.sa
cat /var/log/syslog | grep -o "ivanov.as" | wc -l > ivanov.sa
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question