https://github.com/jrzingel/geologs
Slack bot to watch log files and run basic server commands
https://github.com/jrzingel/geologs
bot python slack
Last synced: 5 months ago
JSON representation
Slack bot to watch log files and run basic server commands
- Host: GitHub
- URL: https://github.com/jrzingel/geologs
- Owner: jrzingel
- License: other
- Created: 2024-09-08T00:51:43.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-11-29T07:56:19.000Z (over 1 year ago)
- Last Synced: 2025-05-12T23:50:01.761Z (about 1 year ago)
- Topics: bot, python, slack
- Language: Python
- Homepage: https://pypi.org/project/geologs/
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
  
# 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.
```toml
[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"
```