Files
greptimedb/tests/cases/standalone/common/promql/regex.result
2025-05-23 20:23:23 +08:00

62 lines
1.9 KiB
Plaintext

CREATE TABLE test (
ts timestamp(3) time index,
host STRING,
val BIGINT,
PRIMARY KEY(host),
);
Affected Rows: 0
INSERT INTO TABLE test VALUES
(0, '10.0.160.237:8080', 1),
(0, '10.0.160.237:8081', 1);
Affected Rows: 2
SELECT * FROM test;
+---------------------+-------------------+-----+
| ts | host | val |
+---------------------+-------------------+-----+
| 1970-01-01T00:00:00 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:00:00 | 10.0.160.237:8081 | 1 |
+---------------------+-------------------+-----+
TQL EVAL (0, 100, '15s') test{host=~"(10.0.160.237:8080|10.0.160.237:9090)"};
+---------------------+-------------------+-----+
| ts | host | val |
+---------------------+-------------------+-----+
| 1970-01-01T00:00:00 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:00:15 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:00:30 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:00:45 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:01:00 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:01:15 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:01:30 | 10.0.160.237:8080 | 1 |
+---------------------+-------------------+-----+
TQL EVAL (0, 100, '15s') test{host=~"10\\.0\\.160\\.237:808|nonexistence"};
++
++
TQL EVAL (0, 100, '15s') test{host=~"(10\\.0\\.160\\.237:8080|10\\.0\\.160\\.237:9090)"};
+---------------------+-------------------+-----+
| ts | host | val |
+---------------------+-------------------+-----+
| 1970-01-01T00:00:00 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:00:15 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:00:30 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:00:45 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:01:00 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:01:15 | 10.0.160.237:8080 | 1 |
| 1970-01-01T00:01:30 | 10.0.160.237:8080 | 1 |
+---------------------+-------------------+-----+
DROP TABLE test;
Affected Rows: 0