# Targeting

Targeting
  Specifying which minions should run a command or execute a state by matching against hostnames, or system information, or defined groups, or even combinations thereof.

For example the command `salt web1 apache.signal restart` to restart the Apache httpd server specifies the machine `web1` as the target and the command will only be run on that one minion.

Similarly when using States, the following top file specifies that only the `web1` minion should execute the contents of `webserver.sls`:

    base:
      'web1':
        - webserver

There are many ways to target individual minions or groups of minions in Salt:

- Matching the `minion id`
  - Globbing
  - Regular Expressions
  - Lists
- Grains
  - Listing Grains
  - Grains in the Minion Config
  - Grains in /etc/salt/grains
  - Matching Grains in the Top File
  - Writing Grains
  - Precedence
  - Examples of Grains
  - Syncing Grains
- Node groups
- Compound matchers
- Batch Size

Current Salt release: 0.17.1

#### Previous topic

Developing Salt

#### Next topic

Matching the `minion id`

### Quick search

Enter search terms or a module, class or function name.

### Upcoming SaltStack Events

My conferences on Lanyrd