stack kb synthetics post-synthetic-monitors cli command
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
--namestringrequired- The monitor name.
--typeenumrequired-
The monitor type.
Values: tcp
--alertstring- The alert configuration. The default is
{ status: { enabled: true }, tls: { enabled: true } }. --enabled- Specify whether the monitor is enabled.
--labelsstring- Key-value pairs of labels to associate with the monitor. Labels can be used for filtering and grouping monitors.
--locationsstring[]-
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 locationscommand with the deployment's Kibana URL.- Go to Synthetics > Management and click Create monitor. Locations will be listed in Locations.
Repeatable: pass
--locationsmultiple times to supply more than one value --namespacestring- The namespace field should be lowercase and not contain spaces. The namespace must not include any of the following characters:
*,\,/,?,",<,>,|, whitespace,,,#,:, or-. --paramsstring- The monitor parameters.
--private-locationsstring[]-
The private locations to which the monitors will be deployed. These private locations refer to locations hosted and managed by you, whereas
locationsare hosted by Elastic. You can specify a private location using the location's name. To list available private locations you can: - Run theelastic-synthetics locationscommand 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
locationsorprivate_locationsor 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_failurecan reduce noise related to transient problems. --schedulenumber- The monitor's schedule in minutes. Supported values are
1,3,5,10,15,30,60,120, and240. The default value is3minutes for HTTP, TCP, and ICMP monitors. The default value is10minutes for Browser monitors. --service.namestring- The APM service name.
-
An array of tags.
Repeatable: pass
--tagsmultiple times to supply more than one value --timeoutnumber- 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-allowliststring[]-
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-allowlistmultiple times to supply more than one value --ignore-https-errors- Ignore HTTPS errors.
--inline-scriptstring- The inline script.
--playwright-optionsstring- Playwright options.
--screenshotsenum-
The screenshot option.
Values: on, off, only-on-failure
--synthetics-argsstring[]-
Synthetics agent CLI arguments.
Repeatable: pass
--synthetics-argsmultiple times to supply more than one value --checkstring- The check request settings.
--ipv4- If
true, ping using the ipv4 protocol. --ipv6- If
true, ping using the ipv6 protocol. --max-redirectsnumber- The maximum number of redirects to follow.
--modeenum-
The mode of the monitor. If it is
all, the monitor pings all resolvable IPs for a hostname. If it isany, 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 useall.Values: all, any
--passwordstring- The password for authenticating with the server. The credentials are passed with the request.
--proxy-headersstring- Additional headers to send to proxies during CONNECT requests.
--proxy-urlstring- 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 theproxy_use_local_resolveroption. --responsestring- Controls the indexing of the HTTP response body contents to the
http.response.body.contents field. --sslstring- The TLS/SSL connection settings for use with the HTTPS endpoint. If you don't specify settings, the system defaults are used.
--urlstring- The URL to monitor.
--usernamestring- The username for authenticating with the server. The credentials are passed with the request.
--hoststring- 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".
--waitnumber- 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-filestring- 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-fieldsstring- comma-separated list of fields to include in output (dot-notation supported)
--output-templatestring- Mustache-like template for custom text output (e.g. "{{id}}: {{name}}")
--json-
output as JSON