github.com/KyaXTeam/consul@v1.4.5/website/source/docs/commands/watch.html.markdown.erb (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Commands: Watch"
     4  sidebar_current: "docs-commands-watch"
     5  description: |-
     6    The `watch` command provides a mechanism to watch for changes in a particular data view (list of nodes, service members, key value, etc) and to invoke a process with the latest values of the view. If no process is specified, the current values are dumped to stdout which can be a useful way to inspect data in Consul.
     7  ---
     8  
     9  # Consul Watch
    10  
    11  Command: `consul watch`
    12  
    13  The `watch` command provides a mechanism to watch for changes in a particular
    14  data view (list of nodes, service members, key value, etc) and to invoke
    15  a process with the latest values of the view. If no process is specified,
    16  the current values are dumped to STDOUT which can be a useful way to inspect
    17  data in Consul.
    18  
    19  There is more [documentation on watches here](/docs/agent/watches.html).
    20  
    21  ## Usage
    22  
    23  Usage: `consul watch [options] [child...]`
    24  
    25  The only required option is `-type` which specifies the particular
    26  data view. Depending on the type, various options may be required
    27  or optionally provided. There is more documentation on watch
    28  [specifications here](/docs/agent/watches.html).
    29  
    30  #### API Options
    31  
    32  <%= partial "docs/commands/http_api_options_client" %>
    33  <%= partial "docs/commands/http_api_options_server" %>
    34  
    35  #### Command Options
    36  
    37  * `-key` - Key to watch. Only for `key` type.
    38  
    39  * `-name`- Event name to watch. Only for `event` type.
    40  
    41  * `-passingonly=[true|false]` - Should only passing entries be returned. Defaults to
    42     `false` and only applies for `service` type.
    43  
    44  * `-prefix` - Key prefix to watch. Only for `keyprefix` type.
    45  
    46  * `-service` - Service to watch. Required for `service` type, optional for `checks` type.
    47  
    48  * `-shell` - Optional, use a shell to run the command (can set a custom shell via the
    49    SHELL environment variable). The default value is true.
    50  
    51  * `-state` - Check state to filter on. Optional for `checks` type.
    52  
    53  * `-tag` - Service tag to filter on. Optional for `service` type.
    54  
    55  * `-type` - Watch type. Required, one of "`key`, `keyprefix`, `services`,
    56    `nodes`, `service`, `checks`, or `event`.
    57