A utility for archiving Linux log files.
Project description
A utility for archiving Linux log files
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.tomlfile.
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.tomlfile can be found within thesite-packagesdirectory 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file loggar-0.1.0.tar.gz.
File metadata
- Download URL: loggar-0.1.0.tar.gz
- Upload date:
- Size: 8.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
728d74d1b4014a6985f02b12c12d1f5e04024d46539881aee91dda653b11f305
|
|
| MD5 |
2648a6f1c38170f832aace7cdfb6b37c
|
|
| BLAKE2b-256 |
c024d9dfae2ed559a7234e7e12fd90f76e55f58e69b842a66d90d020ab0da96c
|
File details
Details for the file loggar-0.1.0-py3-none-any.whl.
File metadata
- Download URL: loggar-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb760fbf664216bbca97ff261c5fa1f2fa97c9048e4e21e67e45e972bb419651
|
|
| MD5 |
509ba369094578b0c923020e97612bf8
|
|
| BLAKE2b-256 |
0a6ed70eccf4193a56aee08969af6eedafe1728e45f30523b9ba4c4853980cde
|