Skip to the page content area.
正體中文 | 简体中文 | English

:::

reslog

Description

reslog reverse-resolves IP in the Apache log files. These log files can then be analyzed by another program, like Analog. You can think of it as a replacement of Apache HostNameLookups directive, in the sense that it resolves the client IP altogether once a day.

Caution

Options

./reslog [options] [logfile…]
./reslog [-h|-v]
logfile

The log file to be resolved. Multiple log files are supported. If not specified, it will read from STDIN and output to STDOUT. You can also specify - to read from STDIN. Result of STDIN will go to STDOUT. gzip or bzip2 compressed files are supported, too.

-k, --keep mode

What to keep in the source file. Currently the following modes are supported:

a, all

Keep the source file after records are archived.

r, restart

Restart the source file after records are resolved.

d, delete

Delete the source file after records are resolved. This is the default.

-o, --override mode

Whether we should overwrite the existing resolved files. Currently the following modes are supported:

o, overwrite

Overwrite existing target files.

a, append

Append the records to existing target files.

f, fail

Stop processing whenever a target file exists, to prevent destroying existing files by accident. This is the default.

-s, --suffix suf

The suffix to be appended to the output file. If not specified, the default is .resolved.

-t, --trim-suffix suf

The suffix to be trimmed from the input file name before appending the above suffix. Default is none. If you are running several log file filters, this can help you trim the suffix of the previous one.

-n, --num-threads num

Number of threads to run simultaneously. The default is 10. Use 0 to disable threading. Your system must support threading itself. This option has no effect for systems that do not support threading.

-c, --stdout

Output the result to STDOUT.

-d, --debug

Show the detailed debugging messages. More -d to be more detailed.

-q, --quiet

Shihhhhhh. Only yell when errors.

-h, --help

Display the help message and exit.

-v, --version

Output version information and exit.

By imacat, first version 2001-07-04, last updated 2009-04-19