|
@@ -292,7 +292,8 @@ GET _data_stream
|
|
|
If the ILM policy has not yet been applied, your results will be like the
|
|
|
following. Note the original `index_name`: `.ds-datastream-<timestamp>-000001`.
|
|
|
|
|
|
-```
|
|
|
+[source,console-result]
|
|
|
+----
|
|
|
{
|
|
|
"data_streams": [
|
|
|
{
|
|
@@ -329,7 +330,9 @@ following. Note the original `index_name`: `.ds-datastream-<timestamp>-000001`.
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
-```
|
|
|
+----
|
|
|
+// TEST[skip:todo]
|
|
|
+// TEST[continued]
|
|
|
|
|
|
Next, run a search query:
|
|
|
|
|
@@ -341,7 +344,8 @@ GET datastream/_search
|
|
|
|
|
|
The query returns your ten newly added documents.
|
|
|
|
|
|
-```
|
|
|
+[source,console-result]
|
|
|
+----
|
|
|
{
|
|
|
"took": 17,
|
|
|
"timed_out": false,
|
|
@@ -357,7 +361,9 @@ The query returns your ten newly added documents.
|
|
|
"relation": "eq"
|
|
|
},
|
|
|
...
|
|
|
-```
|
|
|
+----
|
|
|
+// TEST[skip:todo]
|
|
|
+// TEST[continued]
|
|
|
|
|
|
By default, index lifecycle management checks every ten minutes for indices that
|
|
|
meet policy criteria. Wait for about ten minutes (maybe brew up a quick coffee
|
|
@@ -373,7 +379,8 @@ After the ILM policy has taken effect, the original
|
|
|
`.ds-datastream-2022.08.26-000001` index is replaced with a new, downsampled
|
|
|
index, in this case `downsample-6tkn-.ds-datastream-2022.08.26-000001`.
|
|
|
|
|
|
-```
|
|
|
+[source,console-result]
|
|
|
+----
|
|
|
{
|
|
|
"data_streams": [
|
|
|
{
|
|
@@ -392,7 +399,9 @@ index, in this case `downsample-6tkn-.ds-datastream-2022.08.26-000001`.
|
|
|
}
|
|
|
],
|
|
|
...
|
|
|
-```
|
|
|
+----
|
|
|
+// TEST[skip:todo]
|
|
|
+// TEST[continued]
|
|
|
|
|
|
Run a search query on the datastream.
|
|
|
|
|
@@ -400,13 +409,14 @@ Run a search query on the datastream.
|
|
|
----
|
|
|
GET datastream/_search
|
|
|
----
|
|
|
-// TEST[skip: The @timestamp value won't match an accepted range in the TSDS]
|
|
|
+// TEST[continued]
|
|
|
|
|
|
The new downsampled index contains just one document that includes the `min`,
|
|
|
`max`, `sum`, and `value_count` statistics based off of the original sampled
|
|
|
metrics.
|
|
|
|
|
|
-```
|
|
|
+[source,console-result]
|
|
|
+----
|
|
|
{
|
|
|
"took": 6,
|
|
|
"timed_out": false,
|
|
@@ -483,7 +493,9 @@ metrics.
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
-```
|
|
|
+----
|
|
|
+// TEST[skip:todo]
|
|
|
+// TEST[continued]
|
|
|
|
|
|
Use the <<data-stream-stats-api,data stream stats API>> to get statistics for
|
|
|
the data stream, including the storage size.
|
|
@@ -492,9 +504,10 @@ the data stream, including the storage size.
|
|
|
----
|
|
|
GET /_data_stream/datastream/_stats?human=true
|
|
|
----
|
|
|
-// TEST[skip: The @timestamp value won't match an accepted range in the TSDS]
|
|
|
+// TEST[continued]
|
|
|
|
|
|
-```
|
|
|
+[source,console-result]
|
|
|
+----
|
|
|
{
|
|
|
"_shards": {
|
|
|
"total": 4,
|
|
@@ -515,7 +528,9 @@ GET /_data_stream/datastream/_stats?human=true
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
-```
|
|
|
+----
|
|
|
+// TEST[skip:todo]
|
|
|
+// TEST[continued]
|
|
|
|
|
|
This example demonstrates how downsampling works as part of an ILM policy to
|
|
|
reduce the storage size of metrics data as it becomes less current and less
|