Predict future behavior of a time series
Generally available; Added in 6.1.0
Path parameters
-
Identifier for the anomaly detection job. The job must be open when you create a forecast; otherwise, an error occurs.
Query parameters
-
A period of time that indicates how far into the future to forecast. For example,
30d
corresponds to 30 days. The forecast starts at the last record that was processed.Values are
-1
or0
. -
The period of time that forecast results are retained. After a forecast expires, the results are deleted. If set to a value of 0, the forecast is never automatically deleted.
Values are
-1
or0
. -
The maximum memory the forecast can use. If the forecast needs to use more than the provided amount, it will spool to disk. Default is 20mb, maximum is 500mb and minimum is 1mb. If set to 40% or more of the job’s configured memory limit, it is automatically reduced to below that amount.
POST _ml/anomaly_detectors/low_request_rate/_forecast
{
"duration": "10d"
}
resp = client.ml.forecast(
job_id="low_request_rate",
duration="10d",
)
const response = await client.ml.forecast({
job_id: "low_request_rate",
duration: "10d",
});
response = client.ml.forecast(
job_id: "low_request_rate",
body: {
"duration": "10d"
}
)
$resp = $client->ml()->forecast([
"job_id" => "low_request_rate",
"body" => [
"duration" => "10d",
],
]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"duration":"10d"}' "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_forecast"
client.ml().forecast(f -> f
.duration(d -> d
.time("10d")
)
.jobId("low_request_rate")
);
{
"duration": "10d"
}