2025-07-04 09:00:19 +02:00

23 lines
522 B
Django/Jinja

---
sources:
in_logs_nginx:
type: file
include:
- /var/log/nginx/access.log
- /var/log/nginx/error.log
transforms:
format_logs_nginx:
type: remap
inputs:
- in_logs_nginx
source: |
if (.file == "/var/log/nginx/access.log"){
.http = parse_grok!(.message, "%{HOSTNAME:host} %{HTTPD_COMBINEDLOG}")
} else if (.file == "/var/log/nginx/error.log"){
.http = parse_nginx_log!(.message, format:"error")
}
.service = "nginx"
.group = "web"