stack kb synthetics post-synthetic-monitors cli command

Auth required
elastic stack kb synthetics post-synthetic-monitors \
  --name <name> \
  --type <type> \
  [options]
		

Create a monitor

Behaviour flags:

--dry-run — validate all inputs and exit without performing any action

--name string required
The monitor name.
--type enum required

The monitor type.

Values: tcp

--alert string
The alert configuration. The default is { status: { enabled: true }, tls: { enabled: true } }.
--enabled
Specify whether the monitor is enabled.
--labels string
Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
--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

--namespace string
The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters: *, \, /, ?, ", <, >, |, whitespace, ,, #, :, or -.
--params string
The monitor parameters.
--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

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

--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.
--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.
--service.name string
The APM service name.
--tags string[]

An array of tags.

Repeatable: pass --tags multiple times to supply more than one value

--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.
--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

--ignore-https-errors
Ignore HTTPS errors.
--inline-script string
The inline script.
--playwright-options string
Playwright options.
--screenshots enum

The screenshot option.

Values: on, off, only-on-failure

--synthetics-args string[]

Synthetics agent CLI arguments.

Repeatable: pass --synthetics-args multiple times to supply more than one value

--check string
The check request settings.
--ipv4
If true, ping using the ipv4 protocol.
--ipv6
If true, ping using the ipv6 protocol.
--max-redirects number
The maximum number of redirects to follow.
--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

--password string
The password for authenticating with the server. The credentials are passed with the request.
--proxy-headers string
Additional headers to send to proxies during CONNECT requests.
--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.
--response string
Controls the indexing of the HTTP response body contents to the http.response.body.contents field.
--ssl string
The TLS/SSL connection settings for use with the HTTPS endpoint. If you don't specify settings, the system defaults are used.
--url string
The URL to monitor.
--username string
The username for authenticating with the server. The credentials are passed with the request.
--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".
--wait number
The wait time in seconds.
--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.
--input-file string
path to a JSON file to use as command input
--dry-run
validate all inputs and exit without performing any action (preview changes without applying them)
--no-validate
skip input validation and send the request as-is
--output-fields string
comma-separated list of fields to include in output (dot-notation supported)
--output-template string
Mustache-like template for custom text output (e.g. "{{id}}: {{name}}")
--json

output as JSON