$ curl -L https://github.com/google/mtail/releases/download/v3.0.0-rc16/mtail_v3.0.0-rc16_linux_amd64 -o mtail
$ vim linecounter.mtail
# simple line counter
counter line_count
/$/ {
line_count++
}
$ mtail --progs linecounter.mtail --logs debug.log
$ echo hi1 >> debug.log
$ echo hi2 >> debug.log
$ curl http://localhost:3903/metrics
Reference:
https://groob.io/posts/prometheus-intro/
https://github.com/google/mtail
No comments:
Post a Comment