The script is applicable to those who have enabled the Authentication Process Filter "statistics:StatisticsWithAttribute" but not the SimpleSAMLphp statistics module on the Identity Provider.
It converts the simplesamlphp.log
log file into the format compatible with the statistics
module.
-
Enable
statistics
modulesimplesamlphp/config/config.php
:-
sudo vim /var/simplesamlphp/config/config.php
'module.enable' => [ 'statistics' => true, ],
-
-
Configure it:
-
cp simplesamlphp/modules/statistics/config-templates/*.php simplesamlphp/config/
-
vim simplesamlphp/config/module_statistics.php
'inputfile' => '/var/log/simplesamlphp.stat', 'statdir' => '/var/simplesamlphp/stats/',
-
-
Create the
stats
directory and assign the ownership to the apache user:sudo mkdir /var/simplesamlphp/stats
sudo chown www-data /var/simplesamlphp/stats
-
Insert
ssp-statistics-parser.py
into the same directory of thesimplesamlphp.log
:wget "https://raw.githubusercontent.com/ConsortiumGARR/ssp-statistics-parser/main/ssp-statistics-parser.py" -O /var/simplesamlphp/log/ssp-statistics-parser.py
-
Create the input file
simplesamlphp.stat
:- Python 2:
python ssp-statistics-parser.py > /var/log/simplesamlphp.stat
- Python 3:
python3 ssp-statistics-parser.py > /var/log/simplesamlphp.stat
- Python 2:
-
Configuring the syntax of the logfile as explained in the SimpleSAMLphp statistics module documentation:
cd simplesamlphp/modules/statistics/bin/
loganalyzer.php --debug
-
If check is OK, create statistics with:
sudo loganalyzer.php
-
Find statistical data on the
statistics
web page of your SSP IdP administrative panel.
- Marco Malavolti ([email protected])