CLI whois filtering & cleanup?
I use whois constantly at work (about 30 queries a day on average) and starting to get a bit fed up with all the unnessesary information in each response. Now, I wrote a simple script to parse whois.verisign-grs.com results (jwhois default nowadays) which was simple due to them having key: value -fields. However, for whatever reason, Verisign leaves out all registrant information, which is rather vital. A proper internic query gives all relevant information but in a horrible format, no clean way to parse. (examples of both queries included at bottom)
So, what do you guys and gals use as your whois server chain, and anyone else filtering them, perhaps more successfully? My current line is as simple as: Code:
whois $@ | grep \: | grep -v NOTICE | grep -v TERMS | grep -v 'terms of use' | grep -v 'to: ' | grep -v competing | grep -v "More information" Quote:
Quote:
|
I think gawk would be your friend here. I'm not exactly sure what you're trying to do, and I'm not too familiar with awk either, but something like this would pull out just the Registrant info from that example text you posted.
Code:
BEGIN { trip=0 } $ whois $@ | awk -f SCRIPT |
Seems awk might be the way to go, I keep forgetting how powerful it is.
My ultimate goal is to get consistent, condensed, easy to read information on .com/.net/.org/.eu/.fi domains without the adverts, disclaimers, terms of use and other useless information. Registrar, registrant, nameservers, register, update and expire times. Not for machine use, just for human eyes in a hurry. :) But if anyone knows any good open whois service for com/net, I'm all ears. VeriSign doesn't include enough information and internic will bounce you bad sometimes, just look at 'whois -h whois.internic.net google.com' |
All times are GMT -5. The time now is 05:15 AM. |