jean-cloud-services/services/nginx_exporter/deploy.sh
2024-06-15 17:59:53 +02:00

5 lines
235 B
Bash
Executable File

#!/bin/bash
format="$(grep -oP "^[[:space:]]*log_format main '\K[^;]*(?=';$)" nginx.conf | sed 's/"/\\\\"/g')"
echo "$format"
sed -e "s/%HOST%/$(hostname)/g" -e "s/%FORMAT%/$format/g" exporter_config_template.yml > exporter_config.yml