﻿---
title: stack kb synthetics put-synthetic-monitor cli command
description: Update a monitor Behaviour flags: --dry-run — validate all inputs and exit without performing any action Repeatable: pass --private-locations multiple...
url: https://www.elastic.co/elastic/docs-builder/docs/4492/reference/elastic-cli/cli/stack/kb/synthetics/put-synthetic-monitor
applies_to:
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Preview
---

# stack kb synthetics put-synthetic-monitor cli command
<cli-modifiers>
</cli-modifiers>

```bash
elastic stack kb synthetics put-synthetic-monitor \
  --id <id> \
  --name <name> \
  --type <type> \
  [options]
```

Update a monitor
**Behaviour flags:**
`--dry-run` — validate all inputs and exit without performing any action

## Options

<definitions>
  <definition term="--id string required">
    The identifier for the monitor that you want to update.
  </definition>
  <definition term="--name string required">
    The monitor name.
  </definition>
  <definition term="--type enum required">
    The monitor type.
    **Values:** tcp
  </definition>
  <definition term="--alert string">
    The alert configuration. The default is `{ status: { enabled: true }, tls: { enabled: true } }`.
  </definition>
  <definition term="--enabled">
    Specify whether the monitor is enabled.
  </definition>
  <definition term="--labels string">
    Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
  </definition>
  <definition term="--locations string[]">
    The location to deploy the monitor.
    Monitors can be deployed in multiple locations so that you can detect differences in availability and response times across those locations.
    To list available locations you can: - Run the `elastic-synthetics locations` command with the deployment's Kibana URL.
    - Go to *Synthetics > Management* and click *Create monitor*. Locations will be listed in *Locations*.
    **Repeatable:** pass `--locations` multiple times to supply more than one value
  </definition>
  <definition term="--namespace string">
    The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters: `*`, `\`, `/`, `?`, `"`, `<`, `>`, `|`, whitespace, `,`, `#`, `:`, or `-`.
  </definition>
  <definition term="--params string">
    The monitor parameters.
  </definition>
  <definition term="--private-locations string[]">
    The private locations to which the monitors will be deployed.
    These private locations refer to locations hosted and managed by you, whereas `locations` are hosted by Elastic.
    You can specify a private location using the location's name.
    To list available private locations you can: - Run the `elastic-synthetics locations` command with the deployment's Kibana URL.
    - Go to *Synthetics > Settings* and click *Private locationsr*. Private locations will be listed in the table. > info
  </definition>
</definitions>
> You can provide `locations` or `private_locations` or both. At least one is required.
**Repeatable:** pass `--private-locations` multiple times to supply more than one value
<definitions>
  <definition term="--retest-on-failure">
    Turn retesting for when a monitor fails on or off. By default, monitors are automatically retested if the monitor goes from "up" to "down". If the result of the retest is also "down", an error will be created and if configured, an alert sent. The monitor will then resume running according to the defined schedule. Using `retest_on_failure` can reduce noise related to transient problems.
  </definition>
  <definition term="--schedule number">
    The monitor's schedule in minutes. Supported values are `1`, `3`, `5`, `10`, `15`, `30`, `60`, `120`, and `240`. The default value is `3` minutes for HTTP, TCP, and ICMP monitors. The default value is `10` minutes for Browser monitors.
  </definition>
  <definition term="--service.name string">
    The APM service name.
  </definition>
  <definition term="--tags string[]">
    An array of tags.
    **Repeatable:** pass `--tags` multiple times to supply more than one value
  </definition>
  <definition term="--timeout number">
    The monitor timeout in seconds. The monitor will fail if it doesn't complete within this time. For browser monitors, the minimum timeout is 30 seconds. Browser monitor timeouts are only applied when the monitor runs on private locations. If a browser monitor specifies a timeout but has no private locations configured, the timeout will have no effect and a warning will be returned in the response.
  </definition>
  <definition term="--certificate-error-spki-allowlist string[]">
    PEM certificates whose public keys (SPKI) are allowlisted so Chromium bypasses certificate errors for matching presented certificates. This does not add a CA to Chromium's trust store.
    **Repeatable:** pass `--certificate-error-spki-allowlist` multiple times to supply more than one value
  </definition>
  <definition term="--ignore-https-errors">
    Ignore HTTPS errors.
  </definition>
  <definition term="--inline-script string">
    The inline script.
  </definition>
  <definition term="--playwright-options string">
    Playwright options.
  </definition>
  <definition term="--screenshots enum">
    The screenshot option.
    **Values:** on, off, only-on-failure
  </definition>
  <definition term="--synthetics-args string[]">
    Synthetics agent CLI arguments.
    **Repeatable:** pass `--synthetics-args` multiple times to supply more than one value
  </definition>
  <definition term="--check string">
    The check request settings.
  </definition>
  <definition term="--ipv4">
    If `true`, ping using the ipv4 protocol.
  </definition>
  <definition term="--ipv6">
    If `true`, ping using the ipv6 protocol.
  </definition>
  <definition term="--max-redirects number">
    The maximum number of redirects to follow.
  </definition>
  <definition term="--mode enum">
    The mode of the monitor. If it is `all`, the monitor pings all resolvable IPs for a hostname. If it is `any`, the monitor pings only one IP address for a hostname. If you're using a DNS-load balancer and want to ping every IP address for the specified hostname, you should use `all`.
    **Values:** all, any
  </definition>
  <definition term="--password string">
    The password for authenticating with the server. The credentials are passed with the request.
  </definition>
  <definition term="--proxy-headers string">
    Additional headers to send to proxies during CONNECT requests.
  </definition>
  <definition term="--proxy-url string">
    The URL of the SOCKS5 proxy to use when connecting to the server. The value must be a URL with a scheme of `socks5://`. If the SOCKS5 proxy server requires client authentication, then a username and password can be embedded in the URL. When using a proxy, hostnames are resolved on the proxy server instead of on the client. You can change this behavior by setting the `proxy_use_local_resolver` option.
  </definition>
  <definition term="--response string">
    Controls the indexing of the HTTP response body contents to the `http.response.body.contents field`.
  </definition>
  <definition term="--ssl string">
    The TLS/SSL connection settings for use with the HTTPS endpoint. If you don't specify settings, the system defaults are used.
  </definition>
  <definition term="--url string">
    The URL to monitor.
  </definition>
  <definition term="--username string">
    The username for authenticating with the server. The credentials are passed with the request.
  </definition>
  <definition term="--host string">
    The host to monitor; it can be an IP address or a hostname. The host can include the port using a colon, for example "example.com:9200".
  </definition>
  <definition term="--wait number">
    The wait time in seconds.
  </definition>
  <definition term="--proxy-use-local-resolver">
    Specify that hostnames are resolved locally instead of being resolved on the proxy server. If `false`, name resolution occurs on the proxy server.
  </definition>
  <definition term="--input-file string">
    path to a JSON file to use as command input
  </definition>
  <definition term="--dry-run">
    validate all inputs and exit without performing any action (preview changes without applying them)
  </definition>
  <definition term="--no-validate">
    skip input validation and send the request as-is
  </definition>
</definitions>


## Global Options

<definitions>
  <definition term="--output-fields string">
    comma-separated list of fields to include in output (dot-notation supported)
  </definition>
  <definition term="--output-template string">
    Mustache-like template for custom text output (e.g. "{{id}}: {{name}}")
  </definition>
  <definition term="--json">
    output as JSON
  </definition>
</definitions>