datafeedresource.asciidoc 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-datafeed-resource]]
  4. === {dfeed-cap} resources
  5. A {dfeed} resource has the following properties:
  6. `aggregations`::
  7. (object) If set, the {dfeed} performs aggregation searches.
  8. Support for aggregations is limited and should only be used with
  9. low cardinality data. For more information, see
  10. {stack-ov}/ml-configuring-aggregation.html[Aggregating Data for Faster Performance].
  11. `chunking_config`::
  12. (object) Specifies how data searches are split into time chunks.
  13. See <<ml-datafeed-chunking-config>>.
  14. For example: `{"mode": "manual", "time_span": "3h"}`
  15. `datafeed_id`::
  16. (string) A numerical character string that uniquely identifies the {dfeed}.
  17. This property is informational; you cannot change the identifier for existing
  18. {dfeeds}.
  19. `frequency`::
  20. (time units) The interval at which scheduled queries are made while the
  21. {dfeed} runs in real time. The default value is either the bucket span for short
  22. bucket spans, or, for longer bucket spans, a sensible fraction of the bucket
  23. span. For example: `150s`.
  24. `indices`::
  25. (array) An array of index names. For example: `["it_ops_metrics"]`
  26. `job_id`::
  27. (string) The unique identifier for the job to which the {dfeed} sends data.
  28. `query`::
  29. (object) The {es} query domain-specific language (DSL). This value
  30. corresponds to the query object in an {es} search POST body. All the
  31. options that are supported by {es} can be used, as this object is
  32. passed verbatim to {es}. By default, this property has the following
  33. value: `{"match_all": {"boost": 1}}`.
  34. `query_delay`::
  35. (time units) The number of seconds behind real time that data is queried. For
  36. example, if data from 10:04 a.m. might not be searchable in {es} until
  37. 10:06 a.m., set this property to 120 seconds. The default value is randomly
  38. selected between `60s` and `120s`. This randomness improves the query
  39. performance when there are multiple jobs running on the same node.
  40. `script_fields`::
  41. (object) Specifies scripts that evaluate custom expressions and returns
  42. script fields to the {dfeed}.
  43. The detector configuration objects in a job can contain
  44. functions that use these script fields.
  45. For more information, see
  46. {stack-ov}/ml-configuring-transform.html[Transforming Data With Script Fields].
  47. `scroll_size`::
  48. (unsigned integer) The `size` parameter that is used in {es} searches.
  49. The default value is `1000`.
  50. `delayed_data_check_config`::
  51. (object) Specifies whether the data feed checks for missing data and
  52. the size of the window. For example:
  53. `{"enabled": true, "check_window": "1h"}` See
  54. <<ml-datafeed-delayed-data-check-config>>.
  55. `max_empty_searches`::
  56. (integer) If a real-time {dfeed} has never seen any data (including during
  57. any initial training period) then it will automatically stop itself and
  58. close its associated job after this many real-time searches that return no
  59. documents. In other words, it will stop after `frequency` times
  60. `max_empty_searches` of real-time operation. If not set
  61. then a {dfeed} with no end time that sees no data will remain started until
  62. it is explicitly stopped. By default this setting is not set.
  63. [[ml-datafeed-chunking-config]]
  64. ==== Chunking configuration objects
  65. {dfeeds-cap} might be required to search over long time periods, for several months
  66. or years. This search is split into time chunks in order to ensure the load
  67. on {es} is managed. Chunking configuration controls how the size of these time
  68. chunks are calculated and is an advanced configuration option.
  69. A chunking configuration object has the following properties:
  70. `mode`::
  71. There are three available modes: +
  72. `auto`::: The chunk size will be dynamically calculated. This is the default
  73. and recommended value.
  74. `manual`::: Chunking will be applied according to the specified `time_span`.
  75. `off`::: No chunking will be applied.
  76. `time_span`::
  77. (time units) The time span that each search will be querying.
  78. This setting is only applicable when the mode is set to `manual`.
  79. For example: `3h`.
  80. [[ml-datafeed-delayed-data-check-config]]
  81. ==== Delayed data check configuration objects
  82. The {dfeed} can optionally search over indices that have already been read in
  83. an effort to determine whether any data has subsequently been added to the index.
  84. If missing data is found, it is a good indication that the `query_delay` option
  85. is set too low and the data is being indexed after the {dfeed} has passed that
  86. moment in time. See
  87. {stack-ov}/ml-delayed-data-detection.html[Working with delayed data].
  88. This check runs only on real-time {dfeeds}.
  89. The configuration object has the following properties:
  90. `enabled`::
  91. (boolean) Specifies whether the {dfeed} periodically checks for delayed data.
  92. Defaults to `true`.
  93. `check_window`::
  94. (time units) The window of time that is searched for late data. This window of
  95. time ends with the latest finalized bucket. It defaults to `null`, which
  96. causes an appropriate `check_window` to be calculated when the real-time
  97. {dfeed} runs. In particular, the default `check_window` span calculation is
  98. based on the maximum of `2h` or `8 * bucket_span`.
  99. [float]
  100. [[ml-datafeed-counts]]
  101. ==== {dfeed-cap} counts
  102. The get {dfeed} statistics API provides information about the operational
  103. progress of a {dfeed}. All of these properties are informational; you cannot
  104. update their values:
  105. `assignment_explanation`::
  106. (string) For started {dfeeds} only, contains messages relating to the
  107. selection of a node.
  108. `datafeed_id`::
  109. (string) A numerical character string that uniquely identifies the {dfeed}.
  110. `node`::
  111. (object) The node upon which the {dfeed} is started. The {dfeed} and job will
  112. be on the same node.
  113. `id`::: The unique identifier of the node. For example,
  114. "0-o0tOoRTwKFZifatTWKNw".
  115. `name`::: The node name. For example, `0-o0tOo`.
  116. `ephemeral_id`::: The node ephemeral ID.
  117. `transport_address`::: The host and port where transport HTTP connections are
  118. accepted. For example, `127.0.0.1:9300`.
  119. `attributes`::: For example, `{"ml.machine_memory": "17179869184"}`.
  120. `state`::
  121. (string) The status of the {dfeed}, which can be one of the following values: +
  122. `started`::: The {dfeed} is actively receiving data.
  123. `stopped`::: The {dfeed} is stopped and will not receive data until it is
  124. re-started.
  125. `timing_stats`::
  126. (object) An object that provides statistical information about timing aspect of this datafeed. +
  127. `job_id`::: A numerical character string that uniquely identifies the job.
  128. `search_count`::: Number of searches performed by this datafeed.
  129. `total_search_time_ms`::: Total time the datafeed spent searching in milliseconds.