Skip navigation

Timesaving Utilities Used in a New Way

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.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish