Skip to main content

A utility for archiving Linux log files

PyPI - Version PyPI - Implementation PyPI - Python Version PyPI - Status Static Badge Static Badge Static Badge Documentation Status PyPI - License PyPI - Wheel

Overview

The log ar-chive project (aka loggar) is a Linux command line utility (written in CPython) designed to traverse a network of listed servers and collect, transform and store their log data into a central database.

This approach enables the system administrators to not only archive important log files, but also provides a means by which the logs can be easily retrieved and audited, should the need arise.

Toolset

The current toolset enables the collection and storage of the following log types:

  • Access attempts (successful and failed)

Coming soon:

  • Shutdown/reboot cycles
  • SSH access attempts (successful and failed)

For descriptive usage for each, please refer to the Command Line Usage section.

Installation and Setup

Installation

The easiest way to install loggar is using pip after activating the target virtual environment:

pip install loggar

This will install both the library and the command line utility, but we'll just be using the command line utility.

After installation, check the utility was installed and is accessible using:

loggar --help

Additional (older) releases can be found either at PyPI or in GitHub Releases.

Database setup

First, the MySQL or MariaDB database and tables must be created. The creation scripts are provided for you in the meta/database/setup directory, if you'd like to run the setup yourself. Alternatively, the following command can be called to setup the database for you:

loggar --setup

Note: The database engine must already be installed and at least one user created. Additionally, the user's credentials must be added to the config.toml file.

Config file setup

Once the database is setup, you're ready to update the config file. To do this, simply navigate to the loggar/libs/config.toml file and populate the database credentials to the [database] table.

Next, populate the network hosts which should be swept to the [system.hosts] table. Hosts can be added or removed at any time with no further setup required.

Tip: Both the database setup scripts directory and the config.toml file can be found within the site-packages directory for the target virtual environment.

Command Line Usage

Help and usage

Call up the help and usage menu at any time using:

loggar --help

Collecting and storing: Access attempts

To collect to store user access attempts (failed and successful), use:

loggar --access 

Running on a schedule

To collect logs at regular intervals, a cron task can be setup with the appropriate arguments for the relevant log files.

Note: Remember to include the path to the target virtual environment's Python executable in the cron command.

Troubleshooting

No troubleshooting guidance at this time.

Metadata

Release files for loggar 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loggar 0.1.2
File Size Uploaded Provenance Actions
loggar-0.1.2.tar.gz 8.1 MB Without provenance Details for loggar-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for loggar 0.1.2
File Interpreter ABI Platform Actions
loggar-0.1.2-py3-none-any.whl Python 3 none any Details for loggar-0.1.2-py3-none-any.whl

Total release size: 8.1 MB

Release files / loggar-0.1.2.tar.gz

Download URL loggar-0.1.2.tar.gz
Size 8.1 MB
Tags Source
SHA-256 checksum
How to use checksums
393beb041022b0cd0aa8caede65b8514188f5fe8488fb86de784fc1cfbdedd8a
BLAKE2b-256 checksum
How to use checksums
d9359d1a390229c4d5b0be16ff51d9468b8f75a0e390d950649bf6b76ae3c25d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.8

Release files / loggar-0.1.2-py3-none-any.whl

Download URL loggar-0.1.2-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f83f50bd9b9175b1f08b1aa796a8f9b04e3cf713398280748547fe871b6deab
BLAKE2b-256 checksum
How to use checksums
47e1a8fa33d4bf1f4e6b7b8571854bfe06f5e991c17d091827b0cde328c12e70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.8

Security for loggar 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page