Hi everyone,
Does anyone know of a way to control the line limit of a log file using a variable?
But only in the dashboard, not in the Loki configuration.
It seems that it is not possible to use a variable in the line limit option.
I have not found any operation that performs this step.
Kind regards,
Jo
Simply add the limit count it work fine
You’re not serious, are you? 
I would like to change it using a custom variable, for example.
Of course, the line limit works. But it’s static.
In common LogQL there is the expression line_limit()
Unfortunately, that doesn’t exist in grafana.
Now I found a “solotion” over a additional SQL-Expression.
(the funktion that was added in V12)
But that’s not a good solution, because all lines are generated and then restricted in a subsequent step.
So I think there isn’t a clean solution for this problem.
Jo
1 Like
yes you are right only give number in is limit box not fatch data through variable.
There is a limit, but it’s part of the API, not part of the query language (see Loki HTTP API | Grafana Loki documentation).
I’ve never tried, but perhaps you could use a variable in the Line limit
UI text field?