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

Wildcard in index no longer works (used to) but specifying the index name works #500

Open
julsssark opened this issue Nov 8, 2024 · 5 comments
Labels
datasource/OpenSearch type/bug Something isn't working

Comments

@julsssark
Copy link

julsssark commented Nov 8, 2024

What happened:
Plug-in connected to a Graylog OpenSearch database and was working fine for months. The index field in the connection settings used a wildcard: opnsense_* . Now, when I click "Save & test" in the settings, an "Index not found: opnsense_*" error message is generated. If I change the index to "opnsense_8" (or any other valid index number) everything works fine.

What you expected to happen:
Using a wildcard for the index name does not generate an error on save and would allow for queries across all indexes that match the wildcard pattern.

How to reproduce it (as minimally and precisely as possible):

  1. Navigate to Data Sources->Opensearch connection and open the settings
  2. Confirm that index has a wildcard in it
  3. Click "Save & test". Error should be displayed
  4. Change wildcard to a number that has an existing index in the source
  5. Click "Save & test". Successful message is displayed (Index OK. Time field name OK.)

Anything else we need to know?:
Running into the same error on another OpenSearch connection using a different index (also to Graylog)

Upgraded plug in to 2.21.3 and still see the same issue.

Environment:

  • Grafana version: 11.3
  • OpenSearch version: 2.17.1
  • Plugin version: 2.21.3
@iwysiu
Copy link
Contributor

iwysiu commented Nov 12, 2024

Hi @julsssark ! Thanks for bug report, I've reproduced it and I'll move it to next for one of us to look at soon. We've recently refactored the health check, and we must have missed this case. The queries should still work if they used to, sorry for the inconvenience.

For whoever works on it: for the index opensearch_dashboards_* the old resource health check calls
<opensearchurl>/opensearch_dashboards_%2A/_mapping
and the new one calls <opensearchurl>/opensearch_dashboards_%2A/_mapping/field/<timefield>
I suspect that the field specific endpoint doesn't support the wildcard, which is why it used to work and doesn't now. We should make the healthcheck get all the fields like the old resource handler call and then parse them for the time field.

@iwysiu iwysiu moved this from Incoming to Next in AWS Datasources Nov 12, 2024
@julsssark
Copy link
Author

@iwysiu Thanks for taking a look and confirming my bug report. I really like Grafana and I am happy to help out.

@yakir-shriker
Copy link

Same issue using Graylog with AWS Elasticsearch
Grafana version: 11.3
Elasticsearch version: 6.8
Plugin version: 2.21.3, tested also 2.21.1.

It was working before. We recently upgraded Grafana from 11 to 11.3, and I'm pretty sure that was the trigger for this issue.

@iwysiu
Copy link
Contributor

iwysiu commented Nov 14, 2024

Hi @julsssark and @yakir-shriker ! I just cut a release that reverts the health check code for now https://github.com/grafana/opensearch-datasource/releases/tag/v2.21.4

@julsssark
Copy link
Author

Thank you @iwysiu! I can confirm that plugin 2.21.4 fixes the issue for me. I now can use the wildcard and "Save & Test" no longer generates an error.

@iwysiu iwysiu moved this from Next to Backlog in AWS Datasources Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datasource/OpenSearch type/bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

3 participants