Skip to content

A plugin to enable basic analytics via log reading in the Apache Sling CMS.

License

Notifications You must be signed in to change notification settings

klcodanr/slingcms-loganalytics-plugin

Repository files navigation

CircleCI Quality Gate Status Codacy Badge License

Apache Sling CMS- Log Analytics Plugin

A plugin to enable basic analytics via log reading in the Apache Sling CMS.

Installation

Download the build the code or latest release and install it into an Apache Sling CMS instance via the OSGi console at {sling_cms_host}/system/console/bundles.

A new log will be created for this, fullrequest.log, which will be used for analysis.

Use

Reports can be found at Tools > Log Analytics. To view a report, click on the report name. To edit the report click the pencil.

Reports Console

Filters

Each report has a global filter, which can be pre-populated based on Filtrex expressions against the following variables:

  • time
  • responseTime
  • responseSize
  • status
  • refererPath
  • refererHost
  • language
  • method
  • path
  • protocol
  • host
  • userAgent
  • contentType
  • user
  • sessionId
  • referer
  • platform
  • remoteHost
  • queryString
  • postalCode
  • regionCode
  • countryCode
  • forwardedFor
  • browser
  • browserType
  • browserMajorVersion
  • deviceType
  • platformVersion
  • resolvedPath
  • resolvedIp

To filter the requests for the report, for example:

{
"time": 1594422239000,
"responseTime": 2,
"responseSize": 0,
"status": 200,
"refererPath": "",
"refererHost": "",
"language": "en-US",
"method": "GET",
"path": "/static/clientlibs/sling-cms/js/wysihtml.toolbar.min.map",
"protocol": "HTTP/1.1",
"host": "localhost:8080",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36",
"contentType": "application/json;charset=UTF-8",
"user": "admin",
"sessionId": "node0rs0lrzicp3901q4ov5v3cst8y0.node0",
"referer": "-",
"platform": "macOS",
"remoteHost": "0:0:0:0:0:0:0:1",
"queryString": "",
"postalCode": "",
"regionCode": "",
"countryCode": "",
"forwardedFor": "-",
"browser": "Chrome",
"browserType": "Browser",
"browserMajorVersion": "83",
"deviceType": "Desktop",
"platformVersion": "10.14",
"resolvedPath": "/static/clientlibs/sling-cms/js/wysihtml.toolbar.min.map",
"resolvedIp": "0:0:0:0:0:0:0:1"
}

Each report item also has a filter which can be set to limit the requests for that report. All filters can be defaulted in the edit mode and overriden / changed when viewing the report.

Report Visualizations

There are four report visualizations which can be added and configured in the report:

Timeseries

Displays requests over time.

TimeSeries Report

Grouped Table

Shows the number of requests per a value of one or more fields.

Grouped Table

Pie Chart

Shows the percentage of requests per a value of one or more fields.

Pie Chart

Bar Chart

Shows the percentage of requests per a value of one or more fields.

Bar Chart

Building

This project requires Apache Maven 3 and Java JDK8. To build the project run:

mvn clean install

To install the bundle into a local Sling CMS instance running on port 8080, run:

mvn clean install -P autoInstallBundle

About

A plugin to enable basic analytics via log reading in the Apache Sling CMS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published