Developer documentation

skinparam linetype ortho

folder Client {
    component SyslogHandler
}

folder "Syslog Server" {
    component SyslogServer
    component Backend
    component WebServer

    interface add
    interface query
    interface notify
}

folder Browser {
    component JS
    component GUI
}

database Sqlite

interface syslog
interface http
interface websocket

syslog - SyslogServer
Backend -- Sqlite
add - Backend
Backend - query
Backend - notify
http - WebServer
WebServer -- websocket

SyslogHandler --> syslog
SyslogServer -> add
query <- WebServer
notify -> WebServer

http <-- Browser
websocket <-> JS
JS -> GUI

Web UI backend/frontend communication

Communication between web server and browser is based on Juggler communication.

Server state

Server state is used for providing continuously updated list of log entries to clients, based on applied filters.

State structure is defined by JSON schema hat-syslog://juggler.yaml#/$defs/state (see Juggler JSON Schemas).

Request/response

Juggler request/response communication is used for changing filter parameters.

Request data structures are defined by JSON schema hat-syslog://juggler.yaml#/$defs/request (see Juggler JSON Schemas).

In case of successful request execution, response data is null.

Juggler JSON Schemas

$schema: "https://json-schema.org/draft/2020-12/schema"
$id: "hat-syslog://juggler.yaml"
definitions:
    state:
        type: object
        required:
            - filter
            - entries
            - first_id
            - last_id
        properties:
            filter:
                "$ref": "hat-syslog://juggler.yaml#/$defs/filter"
            entries:
                type: array
                items:
                    "$ref": "hat-syslog://juggler.yaml#/$defs/entry"
            first_id:
                type:
                    - 'null'
                    - integer
            last_id:
                type:
                    - 'null'
                    - integer
    request:
        filter:
            "$ref": "hat-syslog://juggler.yaml#/$defs/filter"
    filter:
        type: object
        required:
            - max_results
            - last_id
            - entry_timestamp_from
            - entry_timestamp_to
            - facility
            - severity
            - hostname
            - app_name
            - procid
            - msgid
            - msg
        properties:
            max_results:
                type:
                    - 'null'
                    - integer
            last_id:
                type:
                    - 'null'
                    - integer
            entry_timestamp_from:
                type:
                    - 'null'
                    - number
            entry_timestamp_to:
                type:
                    - 'null'
                    - number
            facility:
                oneOf:
                    - type: 'null'
                    - "$ref": "hat-syslog://juggler.yaml#/$defs/facility"
            severity:
                oneOf:
                    - type: 'null'
                    - "$ref": "hat-syslog://juggler.yaml#/$defs/severity"
            hostname:
                type:
                    - 'null'
                    - string
            app_name:
                type:
                    - 'null'
                    - string
            procid:
                type:
                    - 'null'
                    - string
            msgid:
                type:
                    - 'null'
                    - string
            msg:
                type:
                    - 'null'
                    - string
    entry:
        type: object
        required:
            - id
            - timestamp
            - msg
        properties:
            id:
                type: integer
            timestamp:
                type: number
            msg:
                "$ref": "hat-syslog://juggler.yaml#/$defs/msg"
    msg:
        type: object
        required:
            - facility
            - severity
            - version
            - timestamp
            - hostname
            - app_name
            - procid
            - msgid
            - data
            - msg
        properties:
            facility:
                oneOf:
                    - type: 'null'
                    - "$ref": "hat-syslog://juggler.yaml#/$defs/facility"
            severity:
                oneOf:
                    - type: 'null'
                    - "$ref": "hat-syslog://juggler.yaml#/$defs/severity"
            version:
                type: integer
            timestamp:
                type:
                    - 'null'
                    - number
            hostname:
                type:
                    - 'null'
                    - string
            app_name:
                type:
                    - 'null'
                    - string
            procid:
                type:
                    - 'null'
                    - string
            msgid:
                type:
                    - 'null'
                    - string
            data:
                type:
                    - 'null'
                    - string
            msg:
                type:
                    - 'null'
                    - string
    facility:
        enum:
            - KERNEL
            - USER
            - MAIL
            - SYSTEM
            - AUTHORIZATION1
            - INTERNAL
            - PRINTER
            - NETWORK
            - UUCP
            - CLOCK1
            - AUTHORIZATION2
            - FTP
            - NTP
            - AUDIT
            - ALERT
            - CLOCK2
            - LOCAL0
            - LOCAL1
            - LOCAL2
            - LOCAL3
            - LOCAL4
            - LOCAL5
            - LOCAL6
            - LOCAL7
    severity:
        enum:
            - EMERGENCY
            - ALERT
            - CRITICAL
            - ERROR
            - WARNING
            - NOTICE
            - INFORMATIONAL
            - DEBUG
...