创建 Datafeeds API
此API可以创建一个datafeed 实例
请求
PUT _xpack/ml/datafeeds/<feed_id>
描述
创建datafeed之前,需要先创建job,可以给每个job创建单独的一个datafeed
路径参数
feed_id
(必填)
用于唯一确认一个datafeed的数字类型的字符串
请求 Body
aggregations
如果设置,此datafeed将执行聚合查询,更多信息,查阅 Datafeed Resources.
chunking_config
指定数据搜索切分为时间块的方式,查询 Chunking Configuration Objects.
frequency
当datafeed在实时运行时候的查询时间间隔。默认值为short bucket,或者设置的间隔,例如150s
indices
(必填)
索引名称的集合,支持索引通配符。例如: ["it_ops_metrics", "server*"]
.
job_id
(必填)
用于唯一标示job的ID
query
Elasticsearch的 DSL查询语句。例如: {"match_all": {"boost": 1}}
.
query_delay
(time units) The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is 60s
.