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-0.9.tar.gz
(8.7 kB
view details)
Built Distribution
geologs-0.9-py3-none-any.whl
(10.1 kB
view details)
File details
Details for the file geologs-0.9.tar.gz
.
File metadata
- Download URL: geologs-0.9.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d83bd6650a011e4dc6097a61d7ed9a3e3d516aa8362f1e7db9c95272ced0a2a3 |
|
MD5 | 3f5ffa1203fa2749b6ed09bce26bbf66 |
|
BLAKE2b-256 | 85deb96b3894d7d3bdc70c5505b2d79c79b66ff1d7910e95346699301dd771fb |
File details
Details for the file geologs-0.9-py3-none-any.whl
.
File metadata
- Download URL: geologs-0.9-py3-none-any.whl
- Upload date:
- Size: 10.1 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 | e554c954bf7fa47c5246a19e925f7fdbc2827c9c1e68def28024637697d8a857 |
|
MD5 | 5b9d98f607d91ea25d93b2c0b1de52c1 |
|
BLAKE2b-256 | 960770bd240669503ece9a7f28da469ea346de4e65c8b5db0332d33273bef61b |