|
@@ -1,7 +1,7 @@
|
|
setup:
|
|
setup:
|
|
- requires:
|
|
- requires:
|
|
- cluster_features: ["gte_v8.11.0"]
|
|
|
|
- reason: "ESQL is available in 8.11+"
|
|
|
|
|
|
+ cluster_features: ["esql.metrics_counter_fields"]
|
|
|
|
+ reason: "require metrics counter fields"
|
|
test_runner_features: allowed_warnings_regex
|
|
test_runner_features: allowed_warnings_regex
|
|
- do:
|
|
- do:
|
|
indices.create:
|
|
indices.create:
|
|
@@ -38,7 +38,7 @@ setup:
|
|
type: long
|
|
type: long
|
|
time_series_metric: counter
|
|
time_series_metric: counter
|
|
rx:
|
|
rx:
|
|
- type: long
|
|
|
|
|
|
+ type: integer
|
|
time_series_metric: counter
|
|
time_series_metric: counter
|
|
- do:
|
|
- do:
|
|
bulk:
|
|
bulk:
|
|
@@ -112,7 +112,6 @@ load everything:
|
|
reason: "_source is available in 8.13+"
|
|
reason: "_source is available in 8.13+"
|
|
- do:
|
|
- do:
|
|
allowed_warnings_regex:
|
|
allowed_warnings_regex:
|
|
- - "Field \\[.*\\] cannot be retrieved, it is unsupported or not indexed; returning null"
|
|
|
|
- "No limit defined, adding default limit of \\[.*\\]"
|
|
- "No limit defined, adding default limit of \\[.*\\]"
|
|
esql.query:
|
|
esql.query:
|
|
body:
|
|
body:
|
|
@@ -126,9 +125,9 @@ load everything:
|
|
- match: {columns.2.name: "k8s.pod.name"}
|
|
- match: {columns.2.name: "k8s.pod.name"}
|
|
- match: {columns.2.type: "keyword"}
|
|
- match: {columns.2.type: "keyword"}
|
|
- match: {columns.3.name: "k8s.pod.network.rx"}
|
|
- match: {columns.3.name: "k8s.pod.network.rx"}
|
|
- - match: {columns.3.type: "unsupported"}
|
|
|
|
|
|
+ - match: {columns.3.type: "counter_integer"}
|
|
- match: {columns.4.name: "k8s.pod.network.tx"}
|
|
- match: {columns.4.name: "k8s.pod.network.tx"}
|
|
- - match: {columns.4.type: "unsupported"}
|
|
|
|
|
|
+ - match: {columns.4.type: "counter_long"}
|
|
- match: {columns.5.name: "k8s.pod.uid"}
|
|
- match: {columns.5.name: "k8s.pod.uid"}
|
|
- match: {columns.5.type: "keyword"}
|
|
- match: {columns.5.type: "keyword"}
|
|
- match: {columns.6.name: "metricset"}
|
|
- match: {columns.6.name: "metricset"}
|
|
@@ -139,7 +138,6 @@ load everything:
|
|
load a document:
|
|
load a document:
|
|
- do:
|
|
- do:
|
|
allowed_warnings_regex:
|
|
allowed_warnings_regex:
|
|
- - "Field \\[.*\\] cannot be retrieved, it is unsupported or not indexed; returning null"
|
|
|
|
- "No limit defined, adding default limit of \\[.*\\]"
|
|
- "No limit defined, adding default limit of \\[.*\\]"
|
|
esql.query:
|
|
esql.query:
|
|
body:
|
|
body:
|
|
@@ -151,25 +149,60 @@ load a document:
|
|
- match: {values.0.0: "2021-04-28T18:50:23.142Z"}
|
|
- match: {values.0.0: "2021-04-28T18:50:23.142Z"}
|
|
- match: {values.0.1: "10.10.55.3"}
|
|
- match: {values.0.1: "10.10.55.3"}
|
|
- match: {values.0.2: "dog"}
|
|
- match: {values.0.2: "dog"}
|
|
- - match: {values.0.3: null }
|
|
|
|
- - match: {values.0.4: null }
|
|
|
|
|
|
+ - match: {values.0.3: 530600088 }
|
|
|
|
+ - match: {values.0.4: 1434577921 }
|
|
- match: {values.0.5: "df3145b3-0563-4d3b-a0f7-897eb2876ea9"}
|
|
- match: {values.0.5: "df3145b3-0563-4d3b-a0f7-897eb2876ea9"}
|
|
- match: {values.0.6: "pod"}
|
|
- match: {values.0.6: "pod"}
|
|
|
|
|
|
---
|
|
---
|
|
-filter on counter:
|
|
|
|
|
|
+filter on counter without cast:
|
|
- do:
|
|
- do:
|
|
- catch: /Cannot use field \[k8s.pod.network.tx\] with unsupported type \[counter\]/
|
|
|
|
|
|
+ catch: bad_request
|
|
esql.query:
|
|
esql.query:
|
|
body:
|
|
body:
|
|
query: 'from test | where k8s.pod.network.tx == 1434577921'
|
|
query: 'from test | where k8s.pod.network.tx == 1434577921'
|
|
version: 2024.04.01
|
|
version: 2024.04.01
|
|
|
|
|
|
|
|
+---
|
|
|
|
+cast counter then filter:
|
|
|
|
+ - do:
|
|
|
|
+ esql.query:
|
|
|
|
+ body:
|
|
|
|
+ query: 'from test | where k8s.pod.network.tx::long == 2005177954 and k8s.pod.network.rx::integer == 801479970 | sort @timestamp | limit 10'
|
|
|
|
+ version: 2024.04.01
|
|
|
|
+ - length: {values: 1}
|
|
|
|
+ - length: {values.0: 7}
|
|
|
|
+ - match: {values.0.0: "2021-04-28T18:50:24.467Z"}
|
|
|
|
+ - match: {values.0.1: "10.10.55.1"}
|
|
|
|
+ - match: {values.0.2: "cat"}
|
|
|
|
+ - match: {values.0.3: 801479970 }
|
|
|
|
+ - match: {values.0.4: 2005177954 }
|
|
|
|
+ - match: {values.0.5: "947e4ced-1786-4e53-9e0c-5c447e959507"}
|
|
|
|
+ - match: {values.0.6: "pod"}
|
|
|
|
+
|
|
|
|
+---
|
|
|
|
+sort on counter without cast:
|
|
|
|
+ - do:
|
|
|
|
+ catch: bad_request
|
|
|
|
+ esql.query:
|
|
|
|
+ body:
|
|
|
|
+ query: 'from test | KEEP k8s.pod.network.tx | sort @k8s.pod.network.tx | limit 1'
|
|
|
|
+ version: 2024.04.01
|
|
|
|
+
|
|
|
|
+---
|
|
|
|
+cast then sort on counter:
|
|
|
|
+ - do:
|
|
|
|
+ esql.query:
|
|
|
|
+ body:
|
|
|
|
+ query: 'from test | KEEP k8s.pod.network.tx | EVAL tx=to_long(k8s.pod.network.tx) | sort tx | limit 1'
|
|
|
|
+ version: 2024.04.01
|
|
|
|
+ - length: {values: 1}
|
|
|
|
+ - match: {values.0.0: 1434521831 }
|
|
|
|
+
|
|
---
|
|
---
|
|
from doc with aggregate_metric_double:
|
|
from doc with aggregate_metric_double:
|
|
- do:
|
|
- do:
|
|
allowed_warnings_regex:
|
|
allowed_warnings_regex:
|
|
- - "Field \\[.*\\] cannot be retrieved, it is unsupported or not indexed; returning null"
|
|
|
|
- "No limit defined, adding default limit of \\[.*\\]"
|
|
- "No limit defined, adding default limit of \\[.*\\]"
|
|
esql.query:
|
|
esql.query:
|
|
body:
|
|
body:
|
|
@@ -201,7 +234,6 @@ stats on aggregate_metric_double:
|
|
from index pattern unsupported counter:
|
|
from index pattern unsupported counter:
|
|
- do:
|
|
- do:
|
|
allowed_warnings_regex:
|
|
allowed_warnings_regex:
|
|
- - "Field \\[.*\\] cannot be retrieved, it is unsupported or not indexed; returning null"
|
|
|
|
- "No limit defined, adding default limit of \\[.*\\]"
|
|
- "No limit defined, adding default limit of \\[.*\\]"
|
|
esql.query:
|
|
esql.query:
|
|
body:
|
|
body:
|
|
@@ -219,7 +251,7 @@ from index pattern unsupported counter:
|
|
- match: {columns.4.name: "k8s.pod.name"}
|
|
- match: {columns.4.name: "k8s.pod.name"}
|
|
- match: {columns.4.type: "keyword"}
|
|
- match: {columns.4.type: "keyword"}
|
|
- match: {columns.5.name: "k8s.pod.network.rx"}
|
|
- match: {columns.5.name: "k8s.pod.network.rx"}
|
|
- - match: {columns.5.type: "unsupported"}
|
|
|
|
|
|
+ - match: {columns.5.type: "counter_integer"}
|
|
- match: {columns.6.name: "k8s.pod.network.tx"}
|
|
- match: {columns.6.name: "k8s.pod.network.tx"}
|
|
- match: {columns.6.type: "unsupported"}
|
|
- match: {columns.6.type: "unsupported"}
|
|
- match: {columns.7.name: "k8s.pod.uid"}
|
|
- match: {columns.7.name: "k8s.pod.uid"}
|