Ce contenu n'est pas disponible dans la langue sélectionnée.
21.4. Getting Access Log Statistics
The
logconv.pl
script parses the access log and returns summary information on different users and operations that have been run on the server.
At its simplest, the script simply parses the access log (or logs):
logconv.pl /relative/path/to/accessLog
# logconv.pl /relative/path/to/accessLog
The script can accept wildcards to parse multiple access logs, which is useful if log rotation is used.
logconv.pl /var/log/dirsrv/slapd-instance/access*
# logconv.pl /var/log/dirsrv/slapd-instance/access*
The different options for
logconv.pl
are covered in the manpage and in the Configuration, Command, and File Reference.
There are several different ways that
logconv.pl
can be used to pull general usage information from the access logs.
At its simplest,
logconv.pl
prints a list of total operations, total number of connections, counts per each operation type, counts for some extended operations like persistent searches, and bind information.
In addition to the summary information for operations and connections, more detailed summary information for all of the connections to the server. This information includes things like most common IP addresses used to connect to the server, DNs with the most failed login attempts, total bind DNs used to access the server, and the most common error or return codes.
Additional connection summaries are passed as a single option. For example, listing the number of DNs used to connect to the server (
b
) and the total connection codes returned by the server (c
) are passed as -bc
.
The data can be limited to entries after a certain start time (
-S
), before a certain end time (-E
), or within a range. When start and end times are set, the logconv.pl
first prints the time range given, then the summary for that period.
The start and end period only sets time limits for the data used to generate the total summary counts. It still shows aggregated, or total, counts. To get a view of the patterns in connections and operations to the Directory Server, it is possible to output data with counts per minute (
-M
) or per second (-m
). In this case, the data are printed, in time unit increments, to a specified CSV output file.
logconv.pl -m|-M outputFile accessLogFile
# logconv.pl -m|-M outputFile accessLogFile
For example:
logconv.pl -M /home/output/statsPerMin.txt /var/log/dirsrv/slapd-instance/access*
# logconv.pl -M /home/output/statsPerMin.txt /var/log/dirsrv/slapd-instance/access*
The
-M|-m
options can also be used with the -S
and -E
arguments, to get per-minute or per-second counts within a specific time period.
Each row in the file represents one unit of time, either minute or second, with total counts for that time period. The CSV file (for both per-minute and per-second statistics) contains the following columns, in order:
Time,time_t,Results,Search,Add,Mod,Modrdn,Delete,Abandon,Connections,SSL Conns,Bind,Anon Bind,Unbind,Unindexed
Time,time_t,Results,Search,Add,Mod,Modrdn,Delete,Abandon,Connections,SSL Conns,Bind,Anon Bind,Unbind,Unindexed
The CSV file can be manipulated in any spreadsheet program, like LibreOffice Calc, and in many other business applications. The procedures for importing the CSV data and generating charts or other metrics depends on the application itself.
For example, to create a chart in LibreOffice Calc:
- Open the CSV file.
- Click themenu, and select .
- In the Chart Type area, set the chart type to XY (Scatter).
- Set the subtype to lines only.
- Select the option to sort by X values.
- Accept the defaults in the other screens (particularly, to use the data series in columns and to set the first row and first column as labels), and create the chart.