-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to Filter label_values? #2319
Comments
I noticed the Regex on the query options, but on my case I want to use the filter on the Value group/tags... I would then filter the label_values with the $tag value... On that case the regex will not help much... Or am i missing something? I was wondering because I already use a similar syntax for a prometheus datasource. But on this specific case I need to use Loki as datasource. I also investigated a little bit the API such as "http://localhost:12345/loki/api/v1/label/ServiceName/values" but I did not saw a way where I could add some filter.... But I must say I am a newbie on Loki + Grafana... Have a lot to learn! |
Yes I think this is a Grafana issue.It should use the series API which support your use case and not the labels API. But the long time ago only the labels api was existing. They will come back to you, let's wait their input. |
OK. Just as additional Information, I am using Grafana 7.0.4. |
This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
@pcbl in this blogpost they use a prometheus metric as filter: https://grafana.com/blog/2020/04/08/loki-quick-tip-how-to-create-a-grafana-dashboard-for-searching-logs-using-loki-and-prometheus/
I don't collect any metrics yet. so I cannot use that. |
Has anyone found a work around for this limitation? I'm not using Prometheus but y really need to make a templated logs dashboard. |
Just leaving this here, because a Google search led me to this issue before I could find the currently open one: |
* FIFO cache to evict entries based on used memory size Signed-off-by: Dmitry Shmulevich <[email protected]> * updated ChangeLog Signed-off-by: Dmitry Shmulevich <[email protected]> * fixed 'make lint' Signed-off-by: Dmitry Shmulevich <[email protected]> * fixed 'make check-doc' Signed-off-by: Dmitry Shmulevich <[email protected]> * keeping the option to evict FIFO cache entries based on the count Signed-off-by: Dmitry Shmulevich <[email protected]> * addressed comments Signed-off-by: Dmitry Shmulevich <[email protected]> * updated tests Signed-off-by: Dmitry Shmulevich <[email protected]> * support both count- and memory-based eviction in FIFO cache rename fifocache.size to fifocache.max_size_items Signed-off-by: Dmitry Shmulevich <[email protected]> * fixed 'make lint' Signed-off-by: Dmitry Shmulevich <[email protected]> * addressed comments Signed-off-by: Dmitry Shmulevich <[email protected]> * addressed comments Signed-off-by: Dmitry Shmulevich <[email protected]> * updated comments Signed-off-by: Dmitry Shmulevich <[email protected]> * addressed comments Signed-off-by: Dmitry Shmulevich <[email protected]> * do not create fifo cache if both 'max_size_bytes' and 'max_size_items' are set to zero Signed-off-by: Dmitry Shmulevich <[email protected]> * use 'container/list' for doubly linked list Signed-off-by: Dmitry Shmulevich <[email protected]> * check fifo cache for nil pointer Signed-off-by: Dmitry Shmulevich <[email protected]> * allow both fifocache.max-size-bytes and fifocache.max-size-items to have non-zero values Signed-off-by: Dmitry Shmulevich <[email protected]> * fifo cache to store []byte as a value Signed-off-by: Dmitry Shmulevich <[email protected]> * remove redundant Put() function Signed-off-by: Dmitry Shmulevich <[email protected]> * make sizeOf(*cacheEntry) more precise Signed-off-by: Dmitry Shmulevich <[email protected]>
Hi Folks,
I am a bit Newbie to Loki + Grafana and I believe I am doing something wrong.... But my proble is quite simple:
I am building on grafana a query variable which presents the values of a given label(ServiceName on my sample). Simple as that:
label_values(ServiceName)
This query would return something like:
So far so good. My issue starts when I try to actually filter these results... let´s say i would like to see only services which starts with L... Loki and LogService from my sample... Based on some samples I saw during some search, it should be set as something like this:
label_values({ServiceName=~"L.*"}, ServiceName)
The issue is that the
{ServiceName=~"L.*"}
bit seems to be completelly ignored... as it has absolutelly no effect and all values mentioned above, including the ones which DOESN`T start with L....What am I doing wrong? How could I get this working? Can anyone share some advise?
Many thanks in advance!
BR
Pedro
The text was updated successfully, but these errors were encountered: