Skip to content

Commit 7c7568b

Browse files
committed
Split ES|QL functions/operators/commands into separate pages for similar functions and make commands examples generated (elastic#126279)
While the internal structure of the docs is already split into many (over 1000) sub-pages, the final display for the `Functions and Operators` page is a single giant page, making navigation harder. This PR splits it into separate pages, one for each group of similar functions and one for the operators. Twelve new pages. This PR also bundles a few other related changes. In total what is done is: * Split functions/operators into 12 pages, one for each group, maintaining the existing split of each function/operator into a snippet with dynamically generated examples * Split esql-commands.md into source-commands.md and processing-commands.md, each of which is split into individual snippets, one for each command * Each command snippet has it's examples split out into separate files, if they were examples that were dynamically generated in the older asciidoc system * The examples files are overwritten by the ES|QL unit tests, using a similar mechanism to the examples written for functions and operators) * Some additional refinements to the Kibana definition and markdown files (nicer operator headings, and display text)
1 parent dba5165 commit 7c7568b

File tree

356 files changed

+3233
-2853
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

356 files changed

+3233
-2853
lines changed

docs/redirects.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
redirects:
2+
'reference/query-languages/esql/esql-functions-operators.md': '!reference/query-languages/esql/functions-operators/aggregation-functions.md'
3+
'reference/query-languages/esql/esql-commands.md': '!reference/query-languages/esql/commands/processing-commands.md'

docs/reference/query-languages/esql/_snippets/aggregation-functions.md

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM sample_data
5+
| WHERE @timestamp > NOW() - 1 hour
6+
```
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
ROW a = "2023-01-23T12:15:00.000Z - some text - 127.0.0.1"
5+
| DISSECT a """%{date} - %{msg} - %{ip}"""
6+
| KEEP date, msg, ip
7+
```
8+
9+
| date:keyword | msg:keyword | ip:keyword |
10+
| --- | --- | --- |
11+
| 2023-01-23T12:15:00.000Z | some text | 127.0.0.1 |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
ROW a = "2023-01-23T12:15:00.000Z 127.0.0.1 [email protected] 42"
5+
| GROK a """%{TIMESTAMP_ISO8601:date} %{IP:ip} %{EMAILADDRESS:email} %{NUMBER:num}"""
6+
| KEEP date, ip, email, num
7+
```
8+
9+
| date:keyword | ip:keyword | email:keyword | num:keyword |
10+
| --- | --- | --- | --- |
11+
| 2023-01-23T12:15:00.000Z | 127.0.0.1 | [email protected] | 42 |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
ROW a = "2023-01-23T12:15:00.000Z - some text - 127.0.0.1"
5+
| DISSECT a """%{date} - %{msg} - %{ip}"""
6+
| KEEP date, msg, ip
7+
| EVAL date = TO_DATETIME(date)
8+
```
9+
10+
| msg:keyword | ip:keyword | date:date |
11+
| --- | --- | --- |
12+
| some text | 127.0.0.1 | 2023-01-23T12:15:00.000Z |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
ROW a = "2023-01-23T12:15:00.000Z 127.0.0.1 [email protected] 42"
5+
| GROK a """%{TIMESTAMP_ISO8601:date} %{IP:ip} %{EMAILADDRESS:email} %{NUMBER:num:int}"""
6+
| KEEP date, ip, email, num
7+
```
8+
9+
| date:keyword | ip:keyword | email:keyword | num:integer |
10+
| --- | --- | --- | --- |
11+
| 2023-01-23T12:15:00.000Z | 127.0.0.1 | [email protected] | 42 |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM addresses
5+
| KEEP city.name, zip_code
6+
| GROK zip_code """%{WORD:zip_parts} %{WORD:zip_parts}"""
7+
```
8+
9+
| city.name:keyword | zip_code:keyword | zip_parts:keyword |
10+
| --- | --- | --- |
11+
| Amsterdam | 1016 ED | ["1016", "ED"] |
12+
| San Francisco | CA 94108 | ["CA", "94108"] |
13+
| Tokyo | 100-7014 | null |
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
ROW a = "2023-01-23T12:15:00.000Z 127.0.0.1 [email protected] 42"
5+
| GROK a """%{TIMESTAMP_ISO8601:date} %{IP:ip} %{EMAILADDRESS:email} %{NUMBER:num:int}"""
6+
| KEEP date, ip, email, num
7+
| EVAL date = TO_DATETIME(date)
8+
```
9+
10+
| ip:keyword | email:keyword | num:integer | date:date |
11+
| --- | --- | --- | --- |
12+
| 127.0.0.1 | [email protected] | 42 | 2023-01-23T12:15:00.000Z |
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
% This is generated by ESQL's AbstractFunctionTestCase. Do no edit it. See ../README.md for how to regenerate it.
2+
3+
```esql
4+
FROM employees
5+
| KEEP emp_no, first_name, last_name, height
6+
```
7+
8+
| emp_no:integer | first_name:keyword | last_name:keyword | height:double |
9+
| --- | --- | --- | --- |
10+
| 10001 | Georgi | Facello | 2.03 |
11+
| 10002 | Bezalel | Simmel | 2.08 |
12+
| 10003 | Parto | Bamford | 1.83 |
13+
| 10004 | Chirstian | Koblick | 1.78 |
14+
| 10005 | Kyoichi | Maliniak | 2.05 |

0 commit comments

Comments
 (0)