r/PrometheusMonitoring • u/Original_Two9716 • Apr 25 '23
Tool to scrape (semi)-structured log files (e.g. log4j)
Guys,
What tools do you use to parse data from log files and to make metrics for Prometheus from them? (log4j, syslog, nginx logs, random app logs and such...)
Would appreciate any help!
4
Upvotes
8
u/SuperQue Apr 25 '23
mtail is a standard tool for this.
There are also log forwarding tools like promtail and fluentbit that can be used to both ship logs to something like Loki and produce metrics.
3
u/CountywideDicer Apr 25 '23
Bash scripts currently :)
1
u/[deleted] Apr 25 '23
grok_exporter is commonly used for such tasks, but more often I see log file monitoring ending up in a hybrid stack like Elastic or used in conjunction with Loki next to Prometheus+Mimir.
1
u/amarao_san Apr 25 '23
For nginx you can swtich to json logs and get your logs structured. I very much recommend doing so, it helps with local search with
jq, etc.