[ale] Question about awk
Geoffrey
lists at serioustechnology.com
Thu Sep 17 16:44:35 EDT 2009
Jim Kinney wrote:
> sed 's/.\+\[\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\].\+/\1/' < foo
> where foo has the pile of stuff you want the IP's from.
Typing that gives my fingers cramps!!!
>
> On Wed, Sep 16, 2009 at 7:19 PM, Chuck Payne <terrorpup at gmail.com> wrote:
>> Guys,
>>
>>
>> Another simple question. I am looking into my mail logs, I just like
>> to get the ip that is between []
>>
>> athedsl-4487021.home.otenet.gr[94.71.67.117]:
>> unknown[187.78.66.100]:
>> unknown[192.168.105.11]:
>> c-98-224-185-217.hsd1.mi.comcast.net[98.224.185.217]:
>> athedsl-333802.home.otenet.gr[85.72.159.136]:
>> athedsl-333802.home.otenet.gr[85.72.159.136]:
>> pool-151-202-63-204.ny325.east.verizon.net[151.202.63.204]:
>> ppp-124-122-183-185.revip2.asianet.co.th[124.122.183.185]:
>> unknown[62.68.49.34]:
>>
>>
>> Here my search string...
>>
>> grep 'Recipient address rejected' mail.log | awk '{ print $10 }'
>>
>>
>> I have tried to use sed to remove [] hoping that it would every before
>> and after the [] 's, but it ugly.
>>
>> --
>> ----------------------------------------
>> Discover it! Enjoy it! Share it! openSUSE Linux.
>> -----------------------------------------
>> openSUSE -- http://en.opensuse.org/User:Terrorpup
>> openSUSE Ambassador
>> openSUSE Member
>> skype -- terrorpup
>> twitter -- terrorpup
>> friendfeed -- http://friendfeed.com/terrorpup
>>
>> Come join me at the Atlanta Linux Fest, September 19th, 2009
>> http://atlantalinuxfest.org/.
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>>
>
>
>
--
Until later, Geoffrey
Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety.
- Benjamin Franklin
More information about the Ale
mailing list