Command grep -

Bob Goodwin - Zuni, Virginia, USA bobgoodwin at wildblue.net
Fri Apr 12 20:49:34 UTC 2013


On 12/04/13 16:13, poma wrote:
>> less syslog.txt | grep "DST=17\." does that and solves my immediate need.
> A long list - a two IP addresses!? :)
> Well, if you don't need this *short* IP addresses output .i.e. for a
> 'whois'[1] so you can parse the required IP range i.e. for a net filter,
> nonetheless can serve as a textbook example of how to use awk and other
> tools mentioned - for a general public. ;)
> Have a nice weekend!
>
> poma

I am filtering "syslog.txt" which has about a thousand lines of data for 
DST=17.*  And yes I use whois to identify the numeric address'.

[1]
whois 17.171.4.13 | grep "CIDR\|NetRange"
NetRange:       17.0.0.0 - 17.255.255.255
CIDR:           17.0.0.0/8

whois 174.35.3.56 | grep "CIDR\|NetRange"
NetRange:       174.35.0.0 - 174.35.127.255
CIDR:           174.35.0.0/17

That helps though, e.g.:

[bobg at box10 Downloads]$ whois 199.47.216.179  | grep "CIDR\|NetRange"
NetRange:       199.47.216.0 - 199.47.219.255
CIDR:           199.47.216.0/22

Dropbox.com, another address of interest. She stores image files there.

Bob

-- 

http://www.qrz.com/db/W2BOD

box10   Fedora-18 XFCE Linux



More information about the users mailing list