SDA 4.0 Documentation for SDALOG
NAME
sdalog - Generate a report of SDA usage
USAGE
sdalog -g filename [options]
DESCRIPTION
SDALOG reads the SDA logfile and generates a report on SDA usage.
Note that the logfile read by SDALOG is the special file written
by SDA -- not the access log maintained by the Web server
software.
The name of the logfile is specified in the SDA Manager as a
Global Specification that applies to a group of SDA datasets.
OUTPUT FORMATS
The default output format reports the
following information:
- how many times each SDA program or procedure was executed,
- how many times each dataset (using the name specified in the
SDA Manager) was accessed,
- and how many of the reported procedures were run in each of
the months.
An optional format (used if a '-c' option was
specified) reports the following information:
- the client IP addresses
- and how many times each client executed an SDA procedure.
This style of report can include the full IP addresses or only
the last one, two, or three final segments of the IP addresses.
For example, the last segment of the IP address is the major Net
domain -- like 'COM' or 'EDU'. If the '-c 1' option is
specified, a summary of usage by those major Net domains will be
generated.
OPTIONS
The following command-line options are recognized. Some options
affect the logfile -- the pathname of the file, and which records
in the logfile should be included in the report. Other options
affect the output format -- whether to produce the default output
or the optional IP address output.
The only required option is the specification of the name of the
logfile.
Log File Options
- -g filename
-
The specified filename is the pathname of a logfile maintained by
SDA. (REQUIRED)
- -e filename
- The specified filename contains a list of client IP
addresses, or portions of addresses, (one per line)
to exclude from the report. For example, the
IP address used by the local system programmer might be excluded
from the usual reports. Note that the IP addresses given in this
file are treated as case-insensitive. For
example, if '.Com' is specified, all log entries containing
'.COM', or '.com' in the IP address field of the logfile will be
excluded from the report.
- -f filter_string
- Each line of the logfile is scanned for the presence of the
specified string of characters. If the string
is not contained in a line, that line is excluded from the
report.
This option can be repeated. Only the lines
containing all of the specified filter strings will be included
in the report.
- -F filter_string
- The specified string of characters is used as a selection
filter (as with the '-f' option). However, the filter string is
case-insensitive. In other words, if the
specified filter string is 'gss', lines containing 'gss', 'GSS',
or 'Gss' will all be included in the report.
This option can be repeated. Only the lines
containing all of the specified filter strings will be included
in the report.
- -s study_name
- In each line of the logfile, the field containing the name
of the study or dataset is scanned for the presence of the
specified study name. If the specified study
name is not in a line, that line is excluded from the report.
Note that the study names given in this file are treated as
case-insensitive.
This option can be repeated, in order to
include multiple specified studies in the report.
- -d number
- The specified number is the maximum length, in
characters, of a dataset name or study name to process.
If the logfile is occasionally written incorrectly by the system
because of heavy Web usage, some of the fields can be run
together and produce what appear to be long dataset names.
Setting this option to '10', for example, will cause the SDALOG
program to skip any log entries with a dataset name longer than
10 characters. This option would only be used if the list of
dataset names generated by the program contained run-together
names.
Output Options
-o filename
Output from SDALOG will be written to this file.
If this option is not specified, output will be routed
to the user's screen (standard output).
-c all
The report will list the full IP addresses
of the client computers used by the SDA users (instead
of the default output format). The number of procedures executed
by each client will also be reported.
-c 1
Only the last segment of IP addresses
(major Net domains like EDU, COM, NET, etc.) will be reported
(instead of the full IP address of each user).
-c 2
The last 2 segments of IP addresses will
be reported.
-c 3
The last 3 segments of IP addresses will
be reported.
Miscellaneous Options
-x filename
Write lines with badly formed log entries
(if any) into this file. This option is for diagnostic purposes.
-u
Print out a list of options (but do not
execute the program)
EXAMPLES
- Basic example
- sdalog -g SDAlog -o logreport.txt
- Filter for a specific dataset (GSS2016)
- sdalog -g SDAlog -s gss2016 -o logreport.txt
- Get the major net domains of users
- sdalog -g SDAlog -c 1 -o logreport.txt
CSM, UC Berkeley/ISA
September 5, 2017