OneUptime / oneuptime

OneUptime is the complete open-source observability platform.
https://oneuptime.com
Apache License 2.0
4.79k stars 223 forks source link

And/Or/In operators #1740

Open RegisHubelia opened 2 hours ago

RegisHubelia commented 2 hours ago

Is your feature request related to a problem? Please describe. There doesn't seem to be a way to query for multiple values. Maybe I just didn't found how to do it in the code/documentation.

Describe the solution you'd like It would be really good to be able to do search on multiple values. Example, searching alert custom field for strings, for the sake of simplicity, "A" and "B". Either using Or or And operators so we could find entries in multiple different ways.

{
  "query": {
    "title": {
      "_type": "Or",
      "value": [
        {
            "_type": "Search",
            "value": "A"
        },
        {
            "_type": "Search",
            "value": "B"
        }
      ]
    }
  }
}

// Or Maybe something like:

{
  "query": {
    "customFields": {
      "test":{
        "_type": "In/NotIn...",
        "value": ["A", "B"]
      }
    }
  }
}

Describe alternatives you've considered Create custom code to search for each string and add it to an array - but it adds extra steps for not a lot of added value.

Thank you for your consideration

simlarsen commented 2 hours ago

@RegisHubelia thank you for posting this, It's on our roadmap.

RegisHubelia commented 2 hours ago

Happy to contribute if you have the specifications or guidelines for the feature, I can work on implementing it.

simlarsen commented 1 hour ago

Sure thing! Please feel free to take a stab at it. Will review + comment on your PR