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

Adds support for IN operator as adhoc filter #986

Merged
merged 4 commits into from
Sep 25, 2024
Merged

Conversation

Kenterfie
Copy link
Contributor

@Kenterfie Kenterfie commented Sep 12, 2024

This merge request adds a missing feature, which we have actively used in the past with the Altinity Grafana datasource. In general it allows adhoc filters which make use of the IN operator.

This issue is also addressed in #883

Example adhoc filter

key = ipv4Dst
operator = IN
value = ('1.1.1.xxx','2.2.2.xxx')

Expected additional filter
settings additional_table_filters={'table' : ' ipv4Dst IN (\'1.1.1.xxx\',\'2.2.2.xxx\')'}

Current additional filter output
settings additional_table_filters={'table' : ' ipv4Dst IN \'('1.1.1.xxx','2.2.2.xxx')\' '}

@CLAassistant
Copy link

CLAassistant commented Sep 12, 2024

CLA assistant check
All committers have signed the CLA.

@SpencerTorres
Copy link
Collaborator

Thanks for the contribution! Make sure to sign the CLA and add a CHANGELOG entry. Could you also edit your PR description to include a screenshot or example adhoc value for the IN operator? Is it comma separated or something else?

Copy link
Collaborator

@SpencerTorres SpencerTorres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few notes/questions

src/data/adHocFilter.test.ts Show resolved Hide resolved
src/data/adHocFilter.ts Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
Copy link
Contributor

@aangelisc aangelisc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution @Kenterfie!

@aangelisc aangelisc merged commit 821d81d into grafana:main Sep 25, 2024
15 checks passed
@Kenterfie
Copy link
Contributor Author

Thanks for your fast reaction on that @aangelisc, but one question. I can find the change in the CHANGELOG.md, but can't find it in release 4.4.0? What happened to it?

@aangelisc
Copy link
Contributor

Hi @Kenterfie, apologies this looks like it didn't make it into the 4.4.0 release but was mistakenly included in the CHANGELOG. It'll be out in the next release.

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

Successfully merging this pull request may close these issues.

4 participants