Repeat for each day

Hey here,

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.

Does anyone has an idea on how to achieve that ?

can you explain a bit more, what is the input and what is the expected output?

Of course I’m probably not as clear as I think :smiley:
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
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…

This is my 2 cents…

I’m not using logstash but it’s documents indexed by python script so indeed I can totally do that !
Thanks I think it should do the trick :slight_smile:

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 ! :slight_smile: