Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Elasticsearch: Query variable with multiple fields #31740

Closed
4quarks opened this issue Mar 5, 2021 · 4 comments
Closed

Elasticsearch: Query variable with multiple fields #31740

4quarks opened this issue Mar 5, 2021 · 4 comments
Labels
datasource/Elasticsearch prio/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough interest in it. type/feature-request

Comments

@4quarks
Copy link

4quarks commented Mar 5, 2021

Dear Grafana team,
I would like to know if it is possible to query a variable using multiple fields.
i.e. {"find": "terms", "field": "data.name", "field": "data.name_short", "size": 1000}
I would like to use the information from two fields in the same variable.
Thanks!

@torkelo
Copy link
Member

torkelo commented Mar 6, 2021

How would you use this variable?

@torkelo torkelo added the needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc label Mar 6, 2021
@4quarks
Copy link
Author

4quarks commented Mar 6, 2021

It would be used in the same way as the normal variable. The only thing is that it would collect information from two different fields. Another possibility would be to combine two variables or have multiple queries:
i.e.
{"find": "terms", "field": "data.name"} + {"find": "terms", "field": "data.name_short"}

@Elfo404 Elfo404 changed the title Query variable with multiple fields Elasticsearch: Query variable with multiple fields Mar 17, 2021
@Elfo404
Copy link
Member

Elfo404 commented Mar 17, 2021

Combining 2 variables or having 2 queries for the same variable is not currently possible.

We need to check if this is achievable with a single Terms query (https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-terms-query.html#query-dsl-terms-lookup) and probably we'll need to update how the query is sent/parsed in the elasticsearch plugin

@Elfo404 Elfo404 added datasource/Elasticsearch type/feature-request and removed needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc labels Mar 17, 2021
@Elfo404 Elfo404 added the prio/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough interest in it. label Apr 12, 2021
@IamShubhamGupto
Copy link

Hey @4quarks

Does the query {"find": "terms", "field": "data.name"} return any values? Im also running a terms query but I get None all the time

@grafana grafana locked and limited conversation to collaborators Nov 8, 2022
@matyax matyax converted this issue into discussion #58406 Nov 8, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
datasource/Elasticsearch prio/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough interest in it. type/feature-request
Projects
None yet
Development

No branches or pull requests

4 participants