IP extraction

Regex are useful to cope with basic unix / linux administration tasks.
To extract IP from file, this simple command do the trick :
grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' /var/log/auth.log 15-08-27 - 16:17:00
11.213.54.142
11.213.54.142
11.213.54.142
11.213.54.142
11.213.54.142
11.213.54.142
11.213.54.142
11.213.54.142
11.213.54.142
11.213.54.142
11.213.54.142
188.216.199.96
188.216.199.96
188.216.199.96
188.216.199.96
188.216.199.96
188.216.199.96
188.216.199.96
188.216.199.96
188.216.199.96
188.216.199.96
188.216.199.96
11.213.54.142
11.213.54.142
11.213.54.142
11.213.54.142
11.213.54.142

Continue reading “IP extraction”