Package: restlog
JSON log-structured data storage with REST API.Aboutrestlogprovides simple data storage with REST access for registering
and retrieving arbitrary JSON data. During data registration, additional
meta-data is associated with each entry:entry_idNumber uniquely identifying each entry. This number is generated
byrestlogand provides monotonously rising sequence used for
determining order of entry registrations.timestampTimestamp representing point in time whenrestlogobtained
registration request.addressIP address, as seen byrestlog, of client initiating registration
request.restlogwill try to useX-Forwarded-*HTTP header values
provided by reverse proxy.sourceString label, set by client, used for filtering and additional
identification of client instance.typeString label, set by client, used for filtering and additional
identification of data structure/semantics.dataArbitrary JSON data.Registered entries can be obtained based on optional query parameterslast_entry_id,sourceandtype. Iflast_entry_idis not specified,
resulting entries will contain “newest” entries (entries with greatestentry_idnumber). Iflast_entry_idis specified, resulting entries will
haveentry_idless or equal to specifiedlast_entry_id. Entry retrieval
results always contain lists of entries ordered byentry_idwhere “latest”
entries (entries with greaterentry_id) are first and “oldest” entries are
last.Together with REST API,restlogprovides simple web-based view of data
available through REST API.Runtime requirementspython >=3.8Install$ pip install restlogConfigurationConfiguration structure is defined byJSON schema.Example:log:
    version: 1
host: '127.0.0.1'
port: 23233
db_path: restlog.db
max_results: 100Run$ restlog [--conf restlog.yaml]If path to configuration file is not set, default configuration path$XDG_CONFIG_HOME/restlog/restlog.{yaml|yml|json}is assumed.Oncerestlogis running, web-based data view can be accessed onhttp://<host>:<port>(<host>and<port>are defined by configuration
parameters).REST APIREST API is defined byOpen API schema.Available endpoints:POST/entry/{source}/{type}Registration of single entry with JSON data provided as content
of HTTP request body.GET/entries?source={source}&type={type}&last_entry_id={last_entry_id}&max_results={max_results}Multiple entry retrieval. All query parameters are optional.
HTTP response contains list of entries andmoreflag indicating
if more entries, satisfying provided filters, are available.GET/entry/{entry_id}Single entry retrieval.SecurityIfrestlogis used by clients not running on the same machine, reverse
proxy with additional authentication methods should be used. Additionally,X-Forward-*header entries should be included.Example ofnginxconfiguration:location / {
    proxy_pass        http://127.0.0.1:23233;
    proxy_set_header  X-Real-IP $remote_addr;
    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header  X-Forwarded-Proto $scheme;

    auth_basic            "restlog";
    auth_basic_user_file  /etc/nginx/restlog.htpasswd;
}Licenserestlog - JSON log-structured data storage with REST APICopyright (C) 2021 Bozo KopicThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.