Skip to content
View as Markdown

MatchRule

Source definition: src/bitdrift/public/unary/workflows/v1/workflow.proto#L188-L214

A match rule.

Field Type Description
match_id string
between 1 and 100 chars
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.workflows.v1.GenericMatch(Only one of generic_match, or ootb_match, state_change_match can be set) A match defined by the user.
ootb_match bitdrift.public.unary.workflows.v1.OotbMatch(Only one of ootb_match, or generic_match, state_change_match can be set) 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.
state_change_match bitdrift.public.unary.workflows.v1.StateChangeMatch(Only one of state_change_match, or generic_match, ootb_match can be set) 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.
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": "_i1yUnHjKfmWpCaD5Tazo",
  "sample_rate": 100
}