March 27, 2001

Timesaving Utilities Used in a New Way


RSS
Subscribe to Windows IT Pro | See More UNIX Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

This week, Tim Huckaby and I switched duties so he can bring you some red-hot news about Application Center 2000 (see the Commentary column above). To hold down the fort, I'll discuss a few timesaving utilities you can use in a way that you might have overlooked.

Have you ever been in the situation where you needed a quick answer from an IIS or Proxy Server log file and cringed at the thought because of the file's size or complexity? Or maybe you needed to help proxy users do some troubleshooting. All you needed to do was look at the last few lines of the log. Sounds like a simple undertaking, right?

Wrong! If you're like me, your daily IIS and Proxy Server log files are in the stratospheric range. Some of us are now into daily gigabyte files, thanks to Web pages that require mega objects. Grabbing the latest log files and running them through a log file analyzer or a script is just too much hassle. You need something that works now—on the live log file—so you won't have to wait an eternity to get to the information you need.

If you belong to this group, read on. (If you're a UNIX whiz, just hold tight.) A little gift came to us from the UNIX world.

The first command is FINDSTR. This command is available in both Windows 2000 and Windows NT. FINDSTR is similar to the grep command in UNIX. It lets you quickly scan a file for occurrences. When your manager comes in and demands to see statistics from the new widget virtual directory, you can use FINDSTR to strip out the log file entries for the widget directory and create a new log file with only those entries. Then you can run just this data through your log analyzer and get much more specific and useful information. You can see FINDSTR's syntax in Win2K or NT by typing FINDSTR /? at the command prompt. Here's a sample of the FINDSTR command:

FINDSTR /I /C:"/widget"  ex010303.log

The /I switch means to ignore the case. The /C switch specifies the text you're searching for. Other uses for this command include searching for intrusion attempts.

The other two commands I want to mention are closely related: tail and head. They're available only in the Services for UNIX 2.0 add-on package. This package is very useful—when time is critical, these two utilities are worth more than their $149 sticker price. Let's says your manager now wants to see how users are reacting to changes in the new widget Web site. The daily log file just passed 500GB, and you need only the last 50MB or so. You can use the tail command to grab the end of a log file or the head command to grab its beginning. You can use the switches in both commands to control how many lines you want to peel off the log file. For more information about Services for UNIX 2.0, go to Microsoft's Web site.

These commands are real time savers; tail and head are big time savers because they don't have to read in the entire file first. Used with log analyzers, these utilities let you quickly produce custom reports and give information to your customers.

End of Article



Windows IT Pro Community
Blogs





Top Viewed ArticlesView all articles
WinInfo Short Takes: Week of November 23, 2009

An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...


IIS and Web Administration Whitepapers Best Practices for SharePoint Backup & Recovery

Meeting Compliance Objectives in SharePoint

Improve SharePoint Performance for Remote Workers

Related Events Deep Dive into Windows Server 2008 R2 presented by John Savill

Check out our list of Free Email Newsletters!

IIS and Web Administration eBooks Web Filtering: An Assessment

Understanding and Leveraging Code Signing Technologies

Keeping Your Business Safe from Attack: Monitoring and Managing Your Network Security

Related IIS and Web Administration Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


SQL Server Magazine Office & SharePoint Pro DevProConnections asp.netPRO ITTV
IT Library Technology Resource Directory Connected Home Windows SuperSite
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc.     Terms of Use | Privacy Statement | Reprints and Licensing