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

Support boolean operators on tags in "tag" param on /api/v1/event/ #16

Open
tristanjo-zillow opened this issue Feb 28, 2023 · 0 comments

Comments

@tristanjo-zillow
Copy link

Currently, tags for a given tagName are joined with an implicit "and," e.g.

/api/v1/event?tag=service:myservice&tag=specialTag:1&tag=specialTag:2

will only return events that are tagged with both ["specialTag:1", "specialTag:2"].

Enabling support for "or" and "not" would allow you to filter to events that matched one of several tags, or exclude events with a given tag.

Potential syntax could simply allow for urlencoded "&,|,!" as "and, or, not" respectively in the tag value along with parentheses delimiters, e.g.

service:service1&service2

service:service1|service2

service:!service1

service:(!service1|service2)&service3

Given that the app assumes a backing Mongo db, these can be parsed and mapped to Mongo queries against the "tag" array.

Potential lib for parsing the value: https://github.com/pyparsing/pyparsing

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