eventslog

Introduction
eventslog is the Gerrit events log written in Go.
Prerequisites
Run
version=latest make build
./bin/eventslog --config-file="$PWD"/config/config.yml --listen-port=8080
Docker
version=latest make docker
docker run -v "$PWD"/config:/tmp ghcr.io/gerrittrigger/eventslog:latest --config-file=/tmp/config.yml --listen-port=8080
Usage
usage: eventslog --config-file=CONFIG-FILE [<flags>]
gerrit events log
Flags:
--help Show context-sensitive help (also try --help-long
and --help-man).
--version Show application version.
--config-file=CONFIG-FILE Config file (.yml)
--listen-port=8080 Listen port
--log-level="INFO" Log level (DEBUG|INFO|WARN|ERROR)
Settings
eventslog parameters can be set in the directory config.
An example of configuration in config.yml:
apiVersion: v1
kind: eventslog
metadata:
name: eventslog
spec:
connect:
hostname: localhost
ssh:
keyfile: /path/to/.ssh/id_rsa
keyfilePassword: pass
port: 29418
username: user
storage:
sqlite:
filename: /path/to/sqlite.db
watchdog:
periodSeconds: 20
timeoutSeconds: 20
- spec.connect.hostname: Gerrit host name (e.g., 12:34:56:78)
- spec.watchdog.periodSeconds: Period in seconds (0: turn off)
- spec.watchdog.timeoutSeconds: Timeout in seconds (0: turn off)
API
GET /events/ HTTP/1.0
HTTP/1.1 200 OK
Content-Disposition: attachment
Content-Type: application/json;charset=UTF-8
{
"eventBase64": "ZXZlbnRCYXNlNjQ=",
"eventCreatedOn": 1672214667,
...
}
...
since:'TIME': Events after the give 'TIME', in the format 2023-01-01[ 12:34:56].
until:'TIME': Events before the give 'TIME', in the format 2023-01-01[ 12:34:56].
# Query events which happened between 2023-01-01 and 2023-02-01
curl http://host:port/events/?q=since:2023-01-01+until:2023-02-01
# Query events which happened between 2023-01-01 10:00:00 and 2023-01-01 11:00:00
curl “http://host:port/events/?q=since:%25222023-01-01+10:00:00%2522+until:%25222023-01-01+11:00:00%2522”
License
Project License can be found here.
Reference