# match

## Summary

Matches determine if a request "matches" a specified parameter. In [`rules`](https://greymatter.gitbook.io/grey-matter-documentation/1.7-beta/reference/api/fabric-api/route/match) they are used to see if individual requests should be routed to an upstream cluster.

### Example object

```javascript
{
  "kind": "/services/example/latest/",
  "behavior": "prefix",
  "from": "",
  "to": ""
}
```

### Fields

#### `kind`

One of:

* `cookie`: matches `from.value` against the *Cookie* key `from.key` in the request
* `header`: matches `from.value` against the *Header* key `from.key` in the request
* `query`: matches `from.value` against the *Query* key `from.key` in the request

#### `behavior`

One of:

* `"exact"` :
* `"regex"` :
* `"range"` :
* `"prefix"` :
* `"suffix"` :

Defaults to `exact`

#### `from`

`{"key": "", "value": ""}` pair specifying the source of the match.

#### `to`

`{"key": "", "value": ""}` pair specifying the new location to set based off the match.
