Skip to content
View as Markdown

MatchRule

A match rule.

Field Type Description
match_id string ID of this match rule. Must be unique within the workflow. This is referenced by action rules. See the documentation of individual action rules for restrictions on which match IDs are valid in that context.
generic_match bitdrift.public.unary.explorations.v1.GenericMatch A match defined by the user.

(Only one of generic_match, or ootb_match, state_change_match can be set)
ootb_match bitdrift.public.unary.explorations.v1.OotbMatch An out-of-the-box match for common events that don't require custom field extraction. This is used for common app events like app launch, app background, etc.

(Only one of ootb_match, or generic_match, state_change_match can be set)
state_change_match bitdrift.public.unary.explorations.v1.StateChangeMatch A state change match that looks for changes in the value of a particular state key. This is used for matching on changes in state like connectivity, battery level, etc.

(Only one of state_change_match, or generic_match, ootb_match can be set)
sample_rate optional uint32 The % chance that a match will occur if the condition matches. This is the numerator of the percentage, with the denominator being 1,000,000. For example, if the value is 10,000, then 1% of matches will be sampled.

Example

JSON
{
  "generic_match": {
    "base_matcher": {
      "log_field": "field_name",
      "operator": "EQUAL",
      "string_value": "example"
    }
  },
  "match_id": "match-abc",
  "sample_rate": 100
}