Page History
DSpace
...
DSpace 1.6 and newer versions uses the Apache SOLR application underlying the statistics. SOLR enables performant searching and adding to vast amounts of (usage) data.
Unlike previous versions, enabling statistics in DSpace does not require additional installation or customization. All the necessary software is included.
...
Code Block |
---|
<field name="type" type="integer" indexed="true" stored="true" required="true" /> <field name="id" type="integer" indexed="true" stored="true" required="true" /> <field name="ip" type="string" indexed="true" stored="true" required="false" /> <field name="time" type="date" indexed="true" stored="true" required="true" /> <field name="epersonid" type="integer" indexed="true" stored="true" required="false" /> <field name="continent" type="string" indexed="true" stored="true" required="false"/> <field name="country" type="string" indexed="true" stored="true" required="false"/> <field name="countryCode" type="string" indexed="true" stored="true" required="false"/> <field name="city" type="string" indexed="true" stored="true" required="false"/> <field name="longitude" type="float" indexed="true" stored="true" required="false"/> <field name="latitude" type="float" indexed="true" stored="true" required="false"/> <field name="owningComm" type="integer" indexed="true" stored="true" required="false" multiValued="true"/> <field name="owningColl" type="integer" indexed="true" stored="true" required="false" multiValued="true"/> <field name="owningItem" type="integer" indexed="true" stored="true" required="false" multiValued="true"/> <field name="dns" type="string" indexed="true" stored="true" required="false"/> <field name="userAgent" type="string" indexed="true" stored="true" required="false"/> <field name="isBot" type="boolean" indexed="true" stored="true" required="false"/> <field name="bundleName" type="string" indexed="true" stored="true" required="false" multiValued="true" /> |
The combination of type and id determine which resource (either community, collection, item page or file download) has been requested.
...
The DSpace Statistics Implementation is a Client/Server architecture based on Solr for collecting usage events in the JSPUI and XMLUI user interface applications of DSpace. Solr runs as a separate webapplication and an instance of Apache Http Client is utilized to allow parallel requests to log statistics events into this Solr instance.
Configuration settings for Statistics
...
Property: | server | |||
Example Value: | server = http://127.0.0.1/solr/statistics | |||
Informational Note: | Is used by the SolrLogger Client class to connect to the Solr server over http and perform updates and queries. In most cases, this can (and should) be set to localhost (or 127.0.0.1).
Assuming you get an HTTP 200 OK response, then you should set | |||
Property: | spiderips.urls | |||
Example Value: | spiderips.urls =
| |||
Informational Note: | List of URLs to download spiders files into [DSDOCDEV:dspace]/config/spiders. These files contain lists of known spider IPs and are utilized by the SolrLogger to flag usage events with an "isBot" field, or ignore them entirely.
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="0272d37c-5400-49b2-a351-22fdc0dfa0c2"><ac:plain-text-body><![CDATA[from your [DSDOCDEV:dspace]/bin directory | ]]></ac:plain-text-body></ac:structured-macro> | ||
Property: | dbfile | |||
Example Value: | dbfile = ${dspace.dir}/config/GeoLiteCity.dat | |||
from your [dspace]/bin directory | ||||
Property: | dbfile | |||
Example Value: | dbfile = ${dspace.dir}/config/GeoLiteCity.dat <ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="7a6c269e-963d-4080-ac0c-4b9706d3be7f"><ac:plain-text-body><![CDATA[ | |||
Informational Note: | The following referes to the GeoLiteCity database file utilized by the LocationUtils to calculate the location of client requests based on IP address. During the Ant build process (both fresh_install and update) this file will be downloaded from [http://www.maxmind.com/app/geolitecity] if a new version has been published or it is absent from your [DSDOCDEV:dspace]/config directory. | |||
Property: | resolver.timeout | |||
Example Value: | resolver.timeout = 200 | |||
Informational Note: | Timeout in milliseconds for DNS resolution of origin hosts/IPs. Setting this value too high may result in solr exhausting your connection pool. | |||
Property: | useProxies | |||
Example Value: | useProxies = true | |||
Property: | useProxies | |||
Example Value: | useProxies = true <ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="bb18ac46-0bcb-4dcb-8b7d-3713812e5623"><ac:plain-text-body><![CDATA[ | |||
Informational Note: | Will cause Statistics logging to look for X-Forward URI to detect clients IP that have accessed it through a Proxy service (e.g. the Apache mod_proxy). Allows detection of client IP when accessing DSpace. [Note: This setting is found in the DSpace Logging section of dspace.cfg] | |||
Property: | statistics.item.authorization.admin | |||
Example Value: | statistics.item.authorization.admin = true | |||
Informational Note: | When set to true, only general administrators, collection and community administrators are able to access the statistics from the web user interface. As a result, the links to access statistics are hidden for non logged-in admin users. Setting this property to "false" will display the links to access statistics to anyone, making them publicly available. | |||
Property: | solr.statistics.logBots | |||
Example Value: | solr.statistics.logBots = true | |||
Informational Note: | When this property is set to false, and IP is detected as a spider, the event is not logged. | |||
Property: | solr.statistics.query.filter.spiderIp | |||
Example Value: | solr.statistics.query.filter.spiderIp = false | |||
Informational Note: | If true, statistics queries will filter out spider IPs -- use with caution, as this often results in extremely long query strings. | |||
Property: | solr.statistics.query.filter.isBot | |||
Example Value: | solr.statistics.query.filter.isBot = true | |||
Informational Note: | If true, statistics queries will filter out events flagged with the "isBot" field. This is the recommended method of filtering spiders from statistics. | |||
Property: | query.filter.bundles | |||
Example | query.filter.bundles=ORIGINAL | |||
Informational | A comma seperated list that contains the bundles for which the file statistics will be displayed. |
Upgrade Process for Statistics
...
Example of rebuild and redeploy DSpace (only if you have configured your distribution in this manner)
...
Code Block |
---|
cd [dspace-source]/dspace mvn package cd [dspace-source]/dspace/target/dspace-<version>-build.dir ant -Dconfig=[dspace]/config/dspace.cfg update cp -R [dspace]/webapps/* [TOMCAT]/webapps |
...
The last step is only used if you are not mounting _\[DSDOCDEV:dspace\]/webapps_ directly into your Tomcat, Resin or Jetty host (the recommended practice)If you only need to build the statistics, and don't make any changes to other web applications, you can replace the copy step above do not follow the recommended practice of configuring [dspace]/webapps as location for webapps in your servlet container (Tomcat, Resin or Jetty). If you only need to build the statistics, and don't make any changes to other web applications, you can replace the copy step above with:
Code Block |
---|
cp -R dspace/webapps/solr TOMCAT/webapps |
...
_Again, only if you are not mounting \ [DSDOCDEV:dspace\]/webapps directly into your Tomcat, Resin or Jetty host (the recommended practice)_
Restart your webapps (Tomcat/Jetty/Resin)
...
Statistics Administration
Converting older DSpace logs into SOLR usage data
If you have upgraded from a previous version of DSpace, converting older log files ensures that you carry over older usage stats from before the upgrade.
Statistics Client Utility
The command line interface (CLI) scripts can be used to clean the usage database from additional spider traffic and other maintenance tasks.
...
Code Block |
---|
{dspace.dir}/bin/stats-util -o |
. More information on how these solr server optimizations work can be found here: http://wiki.apache.org/solr/SolrPerformanceFactors#Optimization_Considerations.
...
Code Block |
---|
{dspace.dir}/solr/statistics/conf/solrconfig.xml.
|
Web UI Statistics Modification (XMLUI Only)
...