Skip to main content

A utility for archiving Linux log files.

Project description

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.

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

loggar-0.1.1.tar.gz (8.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

loggar-0.1.1-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file loggar-0.1.1.tar.gz.

File metadata

  • Download URL: loggar-0.1.1.tar.gz
  • Upload date:
  • Size: 8.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for loggar-0.1.1.tar.gz
Algorithm Hash digest
SHA256 125a0f07e3e1ab13085b98359df220f692c99278f0032c499c5aca0c4b35e482
MD5 85f3f774c132460a67586ee2ef95013c
BLAKE2b-256 005d18a3828ed95620a0c9d21ce621cc5451d3bfdf29103d68c60c70727df459

See more details on using hashes here.

File details

Details for the file loggar-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: loggar-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for loggar-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 caaba98eea39c59c77affa4468ff0e2b0c9ef9454191cee40813e83832525fc5
MD5 776a3ad4c3755a6484d907a35bf37f97
BLAKE2b-256 c03d1075a4967179e6737a9b593c1934acbed4cb49022532586ae8e29597e380

See more details on using hashes here.

Supported by

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