https://github.com/klcodanr/slingcms-loganalytics-plugin
A plugin to enable basic analytics via log reading in the Apache Sling CMS.
https://github.com/klcodanr/slingcms-loganalytics-plugin
Last synced: 6 months ago
JSON representation
A plugin to enable basic analytics via log reading in the Apache Sling CMS.
- Host: GitHub
- URL: https://github.com/klcodanr/slingcms-loganalytics-plugin
- Owner: klcodanr
- License: apache-2.0
- Created: 2020-07-11T01:44:22.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-06T13:24:19.000Z (over 3 years ago)
- Last Synced: 2025-07-06T14:49:43.841Z (about 1 year ago)
- Language: Java
- Size: 12.5 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://circleci.com/gh/klcodanr/slingcms-loganalytics-plugin)
[](https://sonarcloud.io/dashboard?id=slingcms-loganalytics-plugin)
[](https://www.codacy.com/manual/klcodanr/slingcms-loganalytics-plugin?utm_source=github.com&utm_medium=referral&utm_content=klcodanr/slingcms-loganalytics-plugin&utm_campaign=Badge_Grade)
[](https://www.apache.org/licenses/LICENSE-2.0)
# Apache Sling CMS- Log Analytics Plugin
A plugin to enable basic analytics via log reading in the
[Apache Sling CMS](https://github.com/apache/org-apache-sling-app-cms).
## Installation
Download the [build the code](#building) 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.

### Filters
Each report has a global filter, which can be pre-populated based on [Filtrex expressions](https://github.com/joewalnes/filtrex) 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.

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

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

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

## 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`