Problems with m Read Json #241
Replies: 1 comment
-
Sorry for the late response. The error message ( However, please note that the In general, you don't need to specify a log format at all when ingesting JSON data, because the log records do not to be parsed (apart from the JSON encoding itself). IIRC, The exporter will assume the JSON record to contain the same files that you'd specify in a |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have a problem reading in my json:
Json von Nginx
{"statusCode":"200","interneZeit":"0.004","anfrageZeit":"0.009","erhaltenBytes":"216","gesendetBytes": "331","dateTime":"14/Jan/2022:19:31:52 +0100","webServer":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15"} {"statusCode":"200","interneZeit":"0.004","anfrageZeit":"0.009","erhaltenBytes":"216","gesendetBytes": "331","dateTime":"14/Jan/2022:19:31:53 +0100","webServer":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15"} {"statusCode":"200","interneZeit":"0.004","anfrageZeit":"0.009","erhaltenBytes":"216","gesendetBytes": "331","dateTime":"14/Jan/2022:19:31:54 +0100","webServer":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.1 Safari/605.1.15"}
Config Datei: prometheus-nginxlog-exporter.hcl
`listen {
port = 4040
address = "0.0.0.0"
}
consul{
enable = false
}
namespace "NginxDaten"
{
source = { files = ["/var/protokoll/nginx/access.json"] }
log_format nginx_json escape=json
'{'
'"statusCode": "$statusCode" , '
'"interneZeit": "$interneZeit" , '
'"anfrageZeit": "$status" , '
'"erhaltenBytes": "$erhaltenBytes" , '
'"gesendetBytes": "$gesendetBytes" , '
'"dateTime": "$dateTime" , '
'"webServer": "$webServer" '
'}';
format = "$statusCode $status $webServer"
labels
{
service = "requestTime"
hostname = "testServer"
environment = "production"
}
histogram_buckets = [.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10]
}`
I get this error message:
prometheus-nginxlog-exporter.service: Start request repeated too quickly. prometheus-nginxlog-exporter.service: Failed with result 'exit-code'. Failed to start NGINX metrics exporter for Prometheus.
This version I have installed "prometheus-nginxlog-exporter_1.9.2_linux_amd64.deb"
Does anyone possibly have an idea why it does not work?
Grüße Meiko
Beta Was this translation helpful? Give feedback.
All reactions