---
search:
  exclude: true
---

# <a id="bitdrift.public.unary.workflows.v1.MatchRule"></a>MatchRule

A match rule.

| Field | Type | Description |
|---|---|---|
| match_id | <span class="proto-type proto-type-primitive">string</span> | 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 | <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">workflows</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">GenericMatch</i>](bitdrift_public_unary_workflows_v1_GenericMatch.md#bitdrift.public.unary.workflows.v1.GenericMatch){ title="bitdrift.public.unary.workflows.v1.GenericMatch"}</span> | A match defined by the user.<br><br>(Only one of <em>generic_match</em>, or <em>ootb_match</em>, <em>state_change_match</em> can be set) |
| ootb_match | <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">workflows</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">OotbMatch</i>](bitdrift_public_unary_workflows_v1_OotbMatch.md#bitdrift.public.unary.workflows.v1.OotbMatch){ title="bitdrift.public.unary.workflows.v1.OotbMatch"}</span> | 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.<br><br>(Only one of <em>ootb_match</em>, or <em>generic_match</em>, <em>state_change_match</em> can be set) |
| state_change_match | <span class="proto-type proto-type-message">[<i class="proto-type-part">bitdrift</i><i class="proto-type-dot">.</i><i class="proto-type-part">public</i><i class="proto-type-dot">.</i><i class="proto-type-part">unary</i><i class="proto-type-dot">.</i><i class="proto-type-part">workflows</i><i class="proto-type-dot">.</i><i class="proto-type-part">v1</i><i class="proto-type-dot">.</i><i class="proto-type-part">StateChangeMatch</i>](bitdrift_public_unary_workflows_v1_StateChangeMatch.md#bitdrift.public.unary.workflows.v1.StateChangeMatch){ title="bitdrift.public.unary.workflows.v1.StateChangeMatch"}</span> | 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.<br><br>(Only one of <em>state_change_match</em>, or <em>generic_match</em>, <em>ootb_match</em> can be set) |
| sample_rate | <span class="proto-type proto-type-primitive">optional uint32</span> | 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
}
```

