Skip to main content

Export logs from ringserver as postgresql timeseries

Project description


Parse ringserver reports, compute statistics and store in influxdb.

ringserver activity

ringserver statistics by day

ringserver statistics by month


ringserverstats is distributed on PyPI as a universal wheel.

    $ pip install ringserverstats

Postgresql preparation

CREATE ROLE resifstats WITH LOGIN PASSWORD 'md5xxxxxxxxxx';
CRATE DATABASE resifstats OWNER resifstats;
\c resifstats

Then go for the migrations :

$ yoyo apply --database postgresql:// -m migrations


docker build -t ringserverstats:latest
docker run --rm -p 8000:8000 -e DATABASE_URI=postgresql:// ringserverstats:latest


To work properly, this program needs the environment variable DATABASE_URI pointing to a valip postgresql URI

Command line interface

$ pip install --user ringserverstats
$ ringserverstats txlogs.log

Web application

For development :

cd webapp
FLASK_ENV=development flask run

In production, use with gunicorn :

pip install gunicorn
cd ringserverstats
gunicorn -b webapp

To send date :

http localhost:8000 < txlogs.log
wget --post-file txlogs.log localhost:8000


The TX logs from ringserver are metrics suitable for a timeserie database. The idea is to parse the logs, as in the exemple below, and to generate values to insert into an influxdb timeseries database.

The file grafana-dashboard.json can be imported into grafana to visualize this timeserie.


The ringserverevents measure has several tags :

  • network, station, location, channel : which data was requested
  • geohash : location of the client in geohash format
  • hosthash : a hash of the client ip (usefull to correlate the clients requests)
  • city : an english city name

Grouping and downsampling

To achieve downsampling, we use timescaledb's continuous query.


ringserverstats is distributed under the terms of the GPL v3 or later. See LICENSE file.


python3 sdist bdist_wheel



Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ringserverstats-0.17.4.tar.gz (17.9 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page