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.2.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.2-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for loggar-0.1.2.tar.gz
Algorithm Hash digest
SHA256 393beb041022b0cd0aa8caede65b8514188f5fe8488fb86de784fc1cfbdedd8a
MD5 6388793ef8e731c374bd8d1d98507dca
BLAKE2b-256 d9359d1a390229c4d5b0be16ff51d9468b8f75a0e390d950649bf6b76ae3c25d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: loggar-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.8

File hashes

Hashes for loggar-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0f83f50bd9b9175b1f08b1aa796a8f9b04e3cf713398280748547fe871b6deab
MD5 e80b86507e9bb1e298283c766fcf9f07
BLAKE2b-256 47e1a8fa33d4bf1f4e6b7b8571854bfe06f5e991c17d091827b0cde328c12e70

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