https://github.com/flashbots/slogth
Ingest logs from stdin and re-emit them with specified delay
https://github.com/flashbots/slogth
Last synced: about 2 months ago
JSON representation
Ingest logs from stdin and re-emit them with specified delay
- Host: GitHub
- URL: https://github.com/flashbots/slogth
- Owner: flashbots
- License: mit
- Created: 2024-11-04T10:05:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-05T08:42:31.000Z (over 1 year ago)
- Last Synced: 2025-02-25T15:16:46.501Z (over 1 year ago)
- Language: Go
- Size: 11.7 KB
- Stars: 1
- Watchers: 13
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# slogth
Ingest logs from stdin and re-emit them with specified delay.
## TL;DR
```shell
ping 1.1.1.1 | ./bin/slogth help --delay 5s
```
```shell
# nothing happens for 5 seconds
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: icmp_seq=0 ttl=57 time=32.841 ms
64 bytes from 1.1.1.1: icmp_seq=1 ttl=57 time=16.679 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=57 time=22.551 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=57 time=24.806 ms
64 bytes from 1.1.1.1: icmp_seq=4 ttl=57 time=34.152 ms
64 bytes from 1.1.1.1: icmp_seq=5 ttl=57 time=25.536 ms
64 bytes from 1.1.1.1: icmp_seq=6 ttl=57 time=27.846 ms
64 bytes from 1.1.1.1: icmp_seq=7 ttl=57 time=23.651 ms
^C64 bytes from 1.1.1.1: icmp_seq=8 ttl=57 time=41.213 ms # <- Ctrl-C
64 bytes from 1.1.1.1: icmp_seq=9 ttl=57 time=20.200 ms
64 bytes from 1.1.1.1: icmp_seq=10 ttl=57 time=46.447 ms
64 bytes from 1.1.1.1: icmp_seq=11 ttl=57 time=27.891 ms
64 bytes from 1.1.1.1: icmp_seq=12 ttl=57 time=26.006 ms # remaining 5 seconds of logs
```
## Usage
```shell
./bin/slogth help
```
```text
NAME:
slogth - delayed logs emission
USAGE:
slogth [global options] command [command options]
VERSION:
0.0.2
COMMANDS:
help show the list of commands or help for one command
GLOBAL OPTIONS:
--version, -v print the version
GENERAL
--delay duration, -d duration delay ingested logs by specified duration (default: 0s) [$SLOGTH_DELAY]
--drop-threshold count count of in-flight messages at which slogth should start dropping them (rate-limit) (default: 0) [$SLOGTH_DROP_THRESHOLD]
--stderr, -e use stderr for output (stdout is used by default) (default: false) [$SLOGTH_STDERR]
```