Slack bot to watch log files and run basic server commands
Project description
Geologs - Slack Bot
- Runs basic system commands and pipes the output to slack
- Watches specified log files and parses new lines before posting them in a specific slack channel
Pull requests welcome.
Installation
pip install geologs
A new Slack application needs to be made for each server. Use manifest.json
as a template for the required permissions.
It is expected the API keys are given as environmental variables as SLACK_BOT_TOKEN
and SLACK_APP_TOKEN
.
python -m geologs --conf=config.toml
Configuration
Define the log files to listen to, delay in seconds between checking the file and an optional parser.
Available parsers can be found in geologs/parsers.py
to format the logs in a pretty format.
[testing]
channel = "#file-logs"
logfile = "test.log"
delay = 10
parser = "basic"
[test2]
channel = "#ssh-logins"
logcmd = "journalctl -u sshd --no-pager -f"
delay = 5
parser = "ssh"
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
geologs-1.0.tar.gz
(8.9 kB
view details)
Built Distribution
geologs-1.0-py3-none-any.whl
(10.3 kB
view details)
File details
Details for the file geologs-1.0.tar.gz
.
File metadata
- Download URL: geologs-1.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bbb954f02f8643c964b675ca7fe7a80c09b481010e860b781df87569dd97063 |
|
MD5 | ecdb13daaf3af926972f2b3741157444 |
|
BLAKE2b-256 | 1bae387c691278db895a667a0a8ae722250f4a96afc53f4c5f2b0c427761ff98 |
File details
Details for the file geologs-1.0-py3-none-any.whl
.
File metadata
- Download URL: geologs-1.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e41a057192ed43eaa80e1713b10a915c4d014cd6c90092cdfe98f580aba1bd3 |
|
MD5 | 989cb154346bf2996c4980814dc5bf8d |
|
BLAKE2b-256 | f633570ee29aca5fb76290a5b6fe13a65325d0bde4e81ef3d3be9495cc1a68c1 |