I´m trying to use the Global variable ‘${__user.login}’ in the query editor and it doesn´t rule. I actually use v9.1.2 Grafana version.
When I use a login like “Name”, Query do exactly I want, but if login is “name@name.es” Query doesn´t give me any result. I’ve tried with ‘${__user.email}’ and nothing.
I’m creating a new user with the same ‘Name’, ‘Email’, ‘Username’ and ‘Password’, like “name@name.es” in order to prove different options of the Global variable ‘$__user’ . How could I use an email in a expression in my query? Where is my mistake?
My query is: SELECT “MID”, “CID” FROM “CID_Table” WHERE CID=‘${__user.login}’
${__user.id} is the ID of the current user. ${__user.login} is the login handle of the current user. ${__user.email} is the email for the current user.
Hello, I’ve tried using both user.login and user.email and get the same behavior.
After writing out my query via code and then click on the query builder,
My Loki query gets truncated from
# Use interval and range variables
You can use some global built-in variables in query variables: `$__interval`, `$__interval_ms`, `$__range`, `$__range_s`, and `$__range_ms`.
For more information, refer to [Global built-in variables]
Loki docs do not state that we can use the built in $__user global variable. It explicitly states the one can use the interval and range vars.
In my loki query, I am able to see that the following global variables are available:
$__dashboard
$__from and $__to
$__interval
$__interval_ms
$__org
$__user
$__user.id
$__range
The following global variables all render my user.id:
$__user.email
$__user.login
I have added email logs to grafana loki and I am trying to create a dashboard that only displays the current user’s email logs. My query looks like this: