So I want to make something quite simple in my head but apparently not that easy in real life.
I have something that should happen each day and produce a specific amount of document into elasticsearch.
I would want to extract this count for each day from elasticsearch and repeat a single stats panel in Grafana for each day of the specified time range (Or I could be ok to fix the time range to 30d).
The idea is to produce a single stat panel with a count of each day and so have an easy report of the last month status for this process.
Of course I’m probably not as clear as I think
So in input I have some documents inside Elasticsearch.
There should be a certain amount of those documents each day (the same amount).
I would want to return a count of those documents inside a dashboard in a stats panel and one panel per day.
I don’t know if it’s more clear.
Thanks for your help.
If you use logstash to ingest the data, better add new field call it day_of_the_month,
you can follow this link https://discuss.elastic.co/t/extract-hour-and-day-from-timestamp/204542/4.
Then make the filed as variable and make it hidden.
In the query use the field day_of_the_month : $variable
And you can make Repeat Option using this variable…
Ok so it works like a charm.
Now I’ve got another question. Since I would want to be as flexible as possible I’ve also included the month as a variable.
So apparently you cannot repeat stats panel with 2 variables but I was thinking of doing a row with the month variable repetition and then stats panel for the days.
But do you know if can we access the current row variables inside the stats panel ?
I’ve tried to use the global variable ${__from:date:MM} in order to get the month of the time range (and it’s working) but apparently you cannot use this formatting for the title of the panel (you get the unix timestamp).
Ok I find a way (not that easy but working).
So if someone want to achieve it in the end you can use ${__from:date:MM} in the month variable to get only the current month and then print it and also filter the day from the index.
Anyway thanks for the help !