Old Release

This documentation relates to an old version of DSpace, version 3.x. Looking for another version? See all documentation.

This DSpace release is end-of-life and is no longer supported.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

DSpace Log Converter

With the release of DSpace 1.6, new statistics software component was added. DSpace's use of Solr for statistics makes it possible to have a database of statistics. With this in mind, there is the issue of the older log files and how a site can use them. The following command process is able to convert the existing log files and then import them for Solr use. The user will need to perform this only once.

The Log Converter command converts log files from dspace.log into an intermediate format that can be inserted into Solr.

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="b47c1e80-7362-4226-8b66-2275b39ecedf"><ac:plain-text-body><![CDATA[

Command used:

[dspace]/bin/dspace stats-log-converter

]]></ac:plain-text-body></ac:structured-macro>

Java class:

org.dspace.statistics.util.ClassicDSpaceLogConverter

Arguments short and long forms):

Description

-i or --in

Input file. Read from standard input if omitted or "-".

-o or --out

Output file. Written to standard output if omitted or "-".

-m or --multiple

Adds a wildcard at the end of input and output, so it would mean dspace.log* would be converted. (For example, the following files would be included because of this argument: dspace.log, dspace.log.1, dspace.log.2, dspace.log.3, etc.)

-n or --newformat

If the log files have been created with DSpace 1.6

-v or --verbose

Display verbose output (helpful for debugging)

-h or --help

Help

The Log Importer command loads into Solr the intermediate log files that have been created by the Log Converter.

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="63ef666e-0eef-443c-a733-d9449f03cca2"><ac:plain-text-body><![CDATA[

Command used:

[dspace]/bin/dspace stats-log-importer

]]></ac:plain-text-body></ac:structured-macro>

Java class:

org.dspace.statistics.util.StatisticsImporter

Arguments (short and long forms):

Description

-i or --in

input file. Read from standard input if omitted or "-".

-m or --multiple

Adds a wildcard at the end of the input, so it would mean dspace.log* would be imported

-s or --skipdns

To skip the reverse DNS lookups that work out where a user is from. (The DNS lookup finds the information about the host from its IP address, such as geographical location, etc. This can be slow, and wouldn't work on a server not connected to the internet.)

-v or --verbose

Display verbose ouput (helpful for debugging)

-l or --local

For developers: allows you to import a log file from another system, so because the handles won't exist, it looks up random items in your local system to add hits to instead.

-h or --help

Help

Although the DSpace Log Converter applies basic spider filtering (Googlebot, Yahoo!, Slurp, MSNbot), it is far from complete. Please refer to Filtering and Pruning Spiders for spider removal operations after converting your old logs.

Filtering and Pruning Spiders

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="8a9f7d50-4dbb-48f4-83b9-606763434946"><ac:plain-text-body><![CDATA[

Command used:

[dspace]/bin/dspace stats-util

]]></ac:plain-text-body></ac:structured-macro>

Java class:

org.dspace.statistics.util.StatisticsClient

Arguments (short and long forms):

Description

-u or -update-spider-files

Update Spider IP Files from internet into /dspace/config/spiders. Downloads Spider files identified in dspace.cfg under property solr.spiderips.urls. See DSpace SOLR Statistics Configuration

-f or -delete-spiders-by-flag

Delete Spiders in Solr By isBot Flag. Will prune out all records that have isBot:true

-i or -delete-spiders-by-ip

Delete Spiders in Solr By IP Address. Will prune out all records that have IPs that match spider IPs.

-m or -mark-spiders

Update isBog Flag in Solr. Marks any records currently stored in statistics that have IP addresses matched in spiders files

-h or -help

Calls up this brief help table at command line.

Notes:

The usage of these options is open for the user to choose. If you wish to keep spider entries in your repository, just mark them using "-m" and they will be excluded from statistics queries when "solr.statistics.query.filter.isBot = true" in the dspace.cfg.

If you want to keep the spiders out of the Solr repository, they can run just use the "-i" option and they will be removed immediately.

There are guards in place to control what can be defined as an IP range for a bot. In [dspace]/config/spiders, spider IP address ranges have to be at least 3 subnet sections in length (12.34.56) and IP Ranges can only be on the smallest subnet [123.123.123.0 - 123.123.123.255]. If not, loading that row will cause exceptions in the DSpace logs and exclude that IP entry.

Routine Solr Index Maintenance

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="95755a21-40b0-4959-9130-b7fc3718326e"><ac:plain-text-body><![CDATA[

Command used:

[dspace]/bin/dspace stats-util

]]></ac:plain-text-body></ac:structured-macro>

Java class:

org.dspace.statistics.util.StatisticsClient

Arguments (short and long forms):

Description

-o or -optimize

Run maintenance on the Solr index.

Notes:

The usage of this this option is strongly recommended. You should run this command daily (from crontab or your system's scheduler), to prevent your servlet container from running out of memory.

  • No labels