I need to count how many times different IP's were in the file.
I'm using this to open file because i don't have
grep rights to do it only with
User lotarc may run the following commands on herbert: (root) /bin/su - censored (root) /bin/su - censored (root) /bin/cat /var/log/nginx/access.log, /bin/cat /var/log/nginx/access.log.1, /bin/zcat /var/log/nginx/access.log.[0-9]*.gz, /bin/cat /var/log/nginx/error.log, /bin/cat /var/log/nginx/error.log.1, /bin/zcat /var/log/nginx/error.log.[0-9]*.gz
sudo cat /var/log/nginx/access.log.1 | grep -E '1ip|2ip|3ip'
My question is how to count this ip's and get the output. I need to count from multiple files like access.log.2.gz
Content of file
some ip - - [30/Sep/2019:07:26:03 +0300] "POST /clientapp/request/signUp HTTP/1.1" 200 0 "-" "python-requests/2.22.0" "-"