stream_remote_process_logs
stream_remote_process_logs
A proof of concept on how to run a process remotely and have its logs streamed through a websocket.
Installation
- Build this piece of shyte
$ git clone https://github.com/kwalter94/stream_remote_process_logs.git
$ cd stream_remote_process_logs
$ shards install
$ make
- Install redis
Usage
-
Start redis on http://localhost:6379
-
Start (websocket) server
./stream_remote_process_logs serve
- Run a command
./stream_remote_process_logs exec -- journalctl -f # journalctl -f is the command we want to stream
- Copy command id from process above and input it at http://localhost:8000 to start receiving logs from the process. You can run a
sudo
command in another window to force some logs to be appended to the journal.
Limitations/Notes
- Redis pub/sub is fire and forget... So you will miss some (a lot) of messages
- Redis streams would be better for this but the underlying library used here does not support them (yet)
Contributing
- Fork it (https://github.com/kwalter94/stream_remote_process_logs/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Walter Kaunda - creator and maintainer
Repository
stream_remote_process_logs
Owner
Statistic
- 0
- 0
- 0
- 0
- 2
- 9 months ago
- January 29, 2024
License
MIT License
Links
Synced at
Mon, 18 Nov 2024 07:56:21 GMT
Languages