How to create a Grafana dashboard from ElasticSearch logs

Viewed 303

I have connected grafana to an elasticsearch data source. The goal is to create metric dashboards out of elastic search logs. I have two lucene queries in grafana. The first query retrieves all logs in the specified log path

log.file.path:\/data\/gitlab\/logs\/gitlab-rails\/release_job_logs.json AND fields.environment:production

The second query retrieves logs in the specified path that has a ‘success’ value in the json.job_status field

log.file.path:\/data\/gitlab\/logs\/gitlab-rails\/release_job_logs.json AND fields.environment:production AND json.job_status:success

I will like to create a dashboard that creates a percentage of the logs with a ‘success’ value in the json.job_status field. So essentially if the first query gives me a count of 100 and the second query gives a count of 90 then the dashboard should display 90%. Which will mean 90% of all logs have a json.job_status:success

The image below shows what I have now from the two queries above. How do I get a percentage dashboard

enter image description here

0 Answers
Related