Using logcat to convert binary logs to ASCII
Steps
- Change to the directory containing the binary log file.
- Make sure that the logcat utility is in your path.
-
Enter the following command:
logcat <options> <input_filename>
The command-line options are:
Option Description -o output_file Specifies where the command output is directed. -a Automatically generates the output filename based on the input filename. If the input is from stdin, this option is ignored.
For example:
logcat -a squid-1.blog squid-2.blog squid-3.blog
generates:
squid-1.log, squid-2.log, squid-3.log
-S Attempts to transform the input to Squid format, if possible. -C Attempts to transform the input to Netscape Common format, if possible. -E Attempts to transform the input to Netscape Extended format, if possible. -2 Attempt to transform the input to Netscape Extended-2 format, if possible. Note:Use only one of the following options at any given time:
-S, -C, -E, or -2.
If no input files are specified, logcat reads from the standard input (stdin). If you do not specify an output file, logcat writes to the standard output (stdout).
For example, to convert a binary log file to an ASCII file, you can use the logcat
command with either of the following options:
logcat binary_file > ascii_file
logcat -o ascii_file binary_file
The binary log file is not modified by this command.