Skip to content
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

Comparison problems with Grafana variables #114

Open
j-prall opened this issue May 4, 2021 · 0 comments
Open

Comparison problems with Grafana variables #114

j-prall opened this issue May 4, 2021 · 0 comments

Comments

@j-prall
Copy link

j-prall commented May 4, 2021

Hi,
at first, I´m working with the Grafana version 7.4.5, with the MongoDb version 4.4 and I´m running it on a lokal host.

I want to filter my Dashboard Variables with multiple variables.
My first Panel shows the variable value and the second panel shows the data i want to filter.

image

The Panels show data if i choose a specific value of the variables but don´t show something when i choose multiple values.
image
one value selected

image
multiple values selected

the query for the comparison is here:
db.berichte2.aggregate ( [{"$match": {
"etestresult.test.results.testcase.@Result": {"$eq": "failed"}
}}, {"$unwind": {
"path": "$etestresult.test.measurands.measurand"
}}, {"$match": {
"etestresult.test.measurands.measurand.@module": {"$eq": "Projektbeschreibung"}
}}, {"$group": {
"_id": {"id": "$etestresult.test.@EndTime"},
"Name": {"$push": "$etestresult.test.measurands.measurand.@name"},
"value": {"$push": "$etestresult.test.measurands.measurand.@value"}
}}, {"$project": {
"ts": {"$toDate": "$_id.id"},
"Maschinentyp": {"$arrayElemAt": ["$value", 0]},
"Maschinenbezeichnung": {"$arrayElemAt": ["$value", 1]},
"Maschinennummer": {"$arrayElemAt": ["$value", 2]},
"SVN-Stand": {"$arrayElemAt": ["$value", 3]},
"_id": 0
}},
{"$match": {"Maschinentyp": {"$eq": "$maschine"}}},
{"$match": {"Maschinenbezeichnung": {"$eq": "$bezeichnung"}}}])

as you can see I just match the variables "$maschine" and "$bezeichnung" with strings of my data.

I don´t find a solution to my Problem but really need one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant