Skip to content

Commit d70d8a0

Browse files
johnmschoonovermjwolfkgeller
authored
Clarify url.query usage to specify full query string format (#2488)
* Clarify url.query usage to specify full query string format This update removes ambiguity around the url.query field by explicitly stating that it should contain the full query string, including compound parameters. An example with multiple query parameters is added to reinforce this guidance. This helps prevent misinterpretation—such as splitting the query into an array of keywords—and promotes consistent, ECS-compliant implementations across ingestion pipelines and tools. * Update CHANGELOG.next.md * generated files from changes * Trim trailing whitespace * update to description and regenerated * fixing changelog * regenerated experimental fields as well * tweaked definition one last time * cleanup per review --------- Co-authored-by: Michael Wolf <michael.wolf@elastic.co> Co-authored-by: Kylie Meli <kylie.geller@elastic.co>
1 parent c916aa9 commit d70d8a0

File tree

11 files changed

+123
-121
lines changed

11 files changed

+123
-121
lines changed

CHANGELOG.next.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Thanks, you're awesome :-) -->
3030

3131
#### Improvements
3232

33+
* Added details for implementation of url.query to avoid ambiguity #2488
34+
3335
#### Deprecated
3436

3537
<!-- All empty sections:

docs/reference/ecs-url.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ URL fields provide support for complete or partial URLs, and supports the breaki
2323
| $$$field-url-password$$$ [url.password](#field-url-password) | Password of the request.<br><br>type: keyword | extended |
2424
| $$$field-url-path$$$ [url.path](#field-url-path) | Path of the request, such as "/search".<br><br>type: wildcard<br><br>![OTel Badge](https://img.shields.io/badge/OpenTelemetry-4a5ca6?style=flat&logo=opentelemetry) [![match](https://img.shields.io/badge/match-93c93e?style=flat)](/reference/ecs-opentelemetry.md#ecs-opentelemetry-relation) [url.path](https://opentelemetry.io/docs/specs/semconv/attributes-registry/url/#url-path) | extended |
2525
| $$$field-url-port$$$ [url.port](#field-url-port) | Port of the request, such as 443.<br><br>type: long<br><br>example: `443`<br><br>![OTel Badge](https://img.shields.io/badge/OpenTelemetry-4a5ca6?style=flat&logo=opentelemetry) [![match](https://img.shields.io/badge/match-93c93e?style=flat)](/reference/ecs-opentelemetry.md#ecs-opentelemetry-relation) [url.port](https://opentelemetry.io/docs/specs/semconv/attributes-registry/url/#url-port) | extended |
26-
| $$$field-url-query$$$ [url.query](#field-url-query) | The query field describes the query string of the request, such as "q=elasticsearch".<br><br>The `?` is excluded from the query string. If a URL contains no `?`, there is no query field. If there is a `?` but no query, the query field exists with an empty string. The `exists` query can be used to differentiate between the two cases.<br><br>type: keyword<br><br>![OTel Badge](https://img.shields.io/badge/OpenTelemetry-4a5ca6?style=flat&logo=opentelemetry) [![match](https://img.shields.io/badge/match-93c93e?style=flat)](/reference/ecs-opentelemetry.md#ecs-opentelemetry-relation) [url.query](https://opentelemetry.io/docs/specs/semconv/attributes-registry/url/#url-query) | extended |
26+
| $$$field-url-query$$$ [url.query](#field-url-query) | The field contains the entire query string, excluding the leading `?` character, such as "q=elasticsearch".<br><br>If a URL contains no `?`, there is no query field. If there is a `?` but no query, the query field exists with an empty string. The `exists` query can be used to differentiate between the two cases.<br><br>type: keyword<br><br>example: `q=elasticsearch&sort=desc`<br><br>![OTel Badge](https://img.shields.io/badge/OpenTelemetry-4a5ca6?style=flat&logo=opentelemetry) [![match](https://img.shields.io/badge/match-93c93e?style=flat)](/reference/ecs-opentelemetry.md#ecs-opentelemetry-relation) [url.query](https://opentelemetry.io/docs/specs/semconv/attributes-registry/url/#url-query) | extended |
2727
| $$$field-url-registered-domain$$$ [url.registered_domain](#field-url-registered-domain) | The highest registered url domain, stripped of the subdomain.<br><br>For example, the registered domain for "foo.example.com" is "example.com".<br><br>This value can be determined precisely with a list like the public suffix list (https://publicsuffix.org). Trying to approximate this by simply taking the last two labels will not work well for TLDs such as "co.uk".<br><br>type: keyword<br><br>example: `example.com`<br><br>![OTel Badge](https://img.shields.io/badge/OpenTelemetry-4a5ca6?style=flat&logo=opentelemetry) [![match](https://img.shields.io/badge/match-93c93e?style=flat)](/reference/ecs-opentelemetry.md#ecs-opentelemetry-relation) [url.registered_domain](https://opentelemetry.io/docs/specs/semconv/attributes-registry/url/#url-registered-domain) | extended |
2828
| $$$field-url-scheme$$$ [url.scheme](#field-url-scheme) | Scheme of the request, such as "https".<br><br>Note: The `:` is not part of the scheme.<br><br>type: keyword<br><br>example: `https`<br><br>![OTel Badge](https://img.shields.io/badge/OpenTelemetry-4a5ca6?style=flat&logo=opentelemetry) [![match](https://img.shields.io/badge/match-93c93e?style=flat)](/reference/ecs-opentelemetry.md#ecs-opentelemetry-relation) [url.scheme](https://opentelemetry.io/docs/specs/semconv/attributes-registry/url/#url-scheme) | extended |
2929
| $$$field-url-subdomain$$$ [url.subdomain](#field-url-subdomain) | The subdomain portion of a fully qualified domain name includes all of the names except the host name under the registered_domain. In a partially qualified domain, or if the the qualification level of the full name cannot be determined, subdomain contains all of the names below the registered domain.<br><br>For example the subdomain portion of "www.east.mydomain.co.uk" is "east". If the domain has multiple levels of subdomain, such as "sub2.sub1.example.com", the subdomain field should contain "sub2.sub1", with no trailing period.<br><br>type: keyword<br><br>example: `east`<br><br>![OTel Badge](https://img.shields.io/badge/OpenTelemetry-4a5ca6?style=flat&logo=opentelemetry) [![match](https://img.shields.io/badge/match-93c93e?style=flat)](/reference/ecs-opentelemetry.md#ecs-opentelemetry-relation) [url.subdomain](https://opentelemetry.io/docs/specs/semconv/attributes-registry/url/#url-subdomain) | extended |

experimental/generated/beats/fields.ecs.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12385,13 +12385,13 @@
1238512385
level: extended
1238612386
type: keyword
1238712387
ignore_above: 2083
12388-
description: 'The query field describes the query string of the request, such
12389-
as "q=elasticsearch".
12388+
description: 'The field contains the entire query string, excluding the leading
12389+
`?` character, such as "q=elasticsearch".
1239012390

12391-
The `?` is excluded from the query string. If a URL contains no `?`, there
12392-
is no query field. If there is a `?` but no query, the query field exists
12393-
with an empty string. The `exists` query can be used to differentiate between
12394-
the two cases.'
12391+
If a URL contains no `?`, there is no query field. If there is a `?` but no
12392+
query, the query field exists with an empty string. The `exists` query can
12393+
be used to differentiate between the two cases.'
12394+
example: q=elasticsearch&sort=desc
1239512395
default_field: false
1239612396
- name: enrichments.indicator.url.registered_domain
1239712397
level: extended
@@ -14045,13 +14045,13 @@
1404514045
level: extended
1404614046
type: keyword
1404714047
ignore_above: 2083
14048-
description: 'The query field describes the query string of the request, such
14049-
as "q=elasticsearch".
14048+
description: 'The field contains the entire query string, excluding the leading
14049+
`?` character, such as "q=elasticsearch".
1405014050

14051-
The `?` is excluded from the query string. If a URL contains no `?`, there
14052-
is no query field. If there is a `?` but no query, the query field exists
14053-
with an empty string. The `exists` query can be used to differentiate between
14054-
the two cases.'
14051+
If a URL contains no `?`, there is no query field. If there is a `?` but no
14052+
query, the query field exists with an empty string. The `exists` query can
14053+
be used to differentiate between the two cases.'
14054+
example: q=elasticsearch&sort=desc
1405514055
default_field: false
1405614056
- name: indicator.url.registered_domain
1405714057
level: extended
@@ -15114,13 +15114,13 @@
1511415114
level: extended
1511515115
type: keyword
1511615116
ignore_above: 2083
15117-
description: 'The query field describes the query string of the request, such
15118-
as "q=elasticsearch".
15117+
description: 'The field contains the entire query string, excluding the leading
15118+
`?` character, such as "q=elasticsearch".
1511915119

15120-
The `?` is excluded from the query string. If a URL contains no `?`, there
15121-
is no query field. If there is a `?` but no query, the query field exists
15122-
with an empty string. The `exists` query can be used to differentiate between
15123-
the two cases.'
15120+
If a URL contains no `?`, there is no query field. If there is a `?` but no
15121+
query, the query field exists with an empty string. The `exists` query can
15122+
be used to differentiate between the two cases.'
15123+
example: q=elasticsearch&sort=desc
1512415124
- name: registered_domain
1512515125
level: extended
1512615126
type: keyword

experimental/generated/csv/fields.csv

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ ECS_Version,Indexed,Field_Set,Field,Type,Level,Normalization,Example,Description
15751575
9.3.0-dev+exp,true,threat,threat.enrichments.indicator.url.password,keyword,extended,,,Password of the request.
15761576
9.3.0-dev+exp,true,threat,threat.enrichments.indicator.url.path,wildcard,extended,,,"Path of the request, such as ""/search""."
15771577
9.3.0-dev+exp,true,threat,threat.enrichments.indicator.url.port,long,extended,,443,"Port of the request, such as 443."
1578-
9.3.0-dev+exp,true,threat,threat.enrichments.indicator.url.query,keyword,extended,,,Query string of the request.
1578+
9.3.0-dev+exp,true,threat,threat.enrichments.indicator.url.query,keyword,extended,,q=elasticsearch&sort=desc,Query string of the request.
15791579
9.3.0-dev+exp,true,threat,threat.enrichments.indicator.url.registered_domain,keyword,extended,,example.com,"The highest registered url domain, stripped of the subdomain."
15801580
9.3.0-dev+exp,true,threat,threat.enrichments.indicator.url.scheme,keyword,extended,,https,Scheme of the url.
15811581
9.3.0-dev+exp,true,threat,threat.enrichments.indicator.url.subdomain,keyword,extended,,east,The subdomain of the domain.
@@ -1798,7 +1798,7 @@ ECS_Version,Indexed,Field_Set,Field,Type,Level,Normalization,Example,Description
17981798
9.3.0-dev+exp,true,threat,threat.indicator.url.password,keyword,extended,,,Password of the request.
17991799
9.3.0-dev+exp,true,threat,threat.indicator.url.path,wildcard,extended,,,"Path of the request, such as ""/search""."
18001800
9.3.0-dev+exp,true,threat,threat.indicator.url.port,long,extended,,443,"Port of the request, such as 443."
1801-
9.3.0-dev+exp,true,threat,threat.indicator.url.query,keyword,extended,,,Query string of the request.
1801+
9.3.0-dev+exp,true,threat,threat.indicator.url.query,keyword,extended,,q=elasticsearch&sort=desc,Query string of the request.
18021802
9.3.0-dev+exp,true,threat,threat.indicator.url.registered_domain,keyword,extended,,example.com,"The highest registered url domain, stripped of the subdomain."
18031803
9.3.0-dev+exp,true,threat,threat.indicator.url.scheme,keyword,extended,,https,Scheme of the url.
18041804
9.3.0-dev+exp,true,threat,threat.indicator.url.subdomain,keyword,extended,,east,The subdomain of the domain.
@@ -1934,7 +1934,7 @@ ECS_Version,Indexed,Field_Set,Field,Type,Level,Normalization,Example,Description
19341934
9.3.0-dev+exp,true,url,url.password,keyword,extended,,,Password of the request.
19351935
9.3.0-dev+exp,true,url,url.path,wildcard,extended,,,"Path of the request, such as ""/search""."
19361936
9.3.0-dev+exp,true,url,url.port,long,extended,,443,"Port of the request, such as 443."
1937-
9.3.0-dev+exp,true,url,url.query,keyword,extended,,,Query string of the request.
1937+
9.3.0-dev+exp,true,url,url.query,keyword,extended,,q=elasticsearch&sort=desc,Query string of the request.
19381938
9.3.0-dev+exp,true,url,url.registered_domain,keyword,extended,,example.com,"The highest registered url domain, stripped of the subdomain."
19391939
9.3.0-dev+exp,true,url,url.scheme,keyword,extended,,https,Scheme of the url.
19401940
9.3.0-dev+exp,true,url,url.subdomain,keyword,extended,,east,The subdomain of the domain.

experimental/generated/ecs/ecs_flat.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21259,13 +21259,13 @@ threat.enrichments.indicator.url.port:
2125921259
type: long
2126021260
threat.enrichments.indicator.url.query:
2126121261
dashed_name: threat-enrichments-indicator-url-query
21262-
description: 'The query field describes the query string of the request, such as
21263-
"q=elasticsearch".
21262+
description: 'The field contains the entire query string, excluding the leading
21263+
`?` character, such as "q=elasticsearch".
2126421264

21265-
The `?` is excluded from the query string. If a URL contains no `?`, there is
21266-
no query field. If there is a `?` but no query, the query field exists with an
21267-
empty string. The `exists` query can be used to differentiate between the two
21268-
cases.'
21265+
If a URL contains no `?`, there is no query field. If there is a `?` but no query,
21266+
the query field exists with an empty string. The `exists` query can be used to
21267+
differentiate between the two cases.'
21268+
example: q=elasticsearch&sort=desc
2126921269
flat_name: threat.enrichments.indicator.url.query
2127021270
ignore_above: 2083
2127121271
level: extended
@@ -24058,13 +24058,13 @@ threat.indicator.url.port:
2405824058
type: long
2405924059
threat.indicator.url.query:
2406024060
dashed_name: threat-indicator-url-query
24061-
description: 'The query field describes the query string of the request, such as
24062-
"q=elasticsearch".
24061+
description: 'The field contains the entire query string, excluding the leading
24062+
`?` character, such as "q=elasticsearch".
2406324063

24064-
The `?` is excluded from the query string. If a URL contains no `?`, there is
24065-
no query field. If there is a `?` but no query, the query field exists with an
24066-
empty string. The `exists` query can be used to differentiate between the two
24067-
cases.'
24064+
If a URL contains no `?`, there is no query field. If there is a `?` but no query,
24065+
the query field exists with an empty string. The `exists` query can be used to
24066+
differentiate between the two cases.'
24067+
example: q=elasticsearch&sort=desc
2406824068
flat_name: threat.indicator.url.query
2406924069
ignore_above: 2083
2407024070
level: extended
@@ -25901,13 +25901,13 @@ url.port:
2590125901
type: long
2590225902
url.query:
2590325903
dashed_name: url-query
25904-
description: 'The query field describes the query string of the request, such as
25905-
"q=elasticsearch".
25904+
description: 'The field contains the entire query string, excluding the leading
25905+
`?` character, such as "q=elasticsearch".
2590625906

25907-
The `?` is excluded from the query string. If a URL contains no `?`, there is
25908-
no query field. If there is a `?` but no query, the query field exists with an
25909-
empty string. The `exists` query can be used to differentiate between the two
25910-
cases.'
25907+
If a URL contains no `?`, there is no query field. If there is a `?` but no query,
25908+
the query field exists with an empty string. The `exists` query can be used to
25909+
differentiate between the two cases.'
25910+
example: q=elasticsearch&sort=desc
2591125911
flat_name: url.query
2591225912
ignore_above: 2083
2591325913
level: extended

experimental/generated/ecs/ecs_nested.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24171,13 +24171,13 @@ threat:
2417124171
type: long
2417224172
threat.enrichments.indicator.url.query:
2417324173
dashed_name: threat-enrichments-indicator-url-query
24174-
description: 'The query field describes the query string of the request, such
24175-
as "q=elasticsearch".
24174+
description: 'The field contains the entire query string, excluding the leading
24175+
`?` character, such as "q=elasticsearch".
2417624176

24177-
The `?` is excluded from the query string. If a URL contains no `?`, there
24178-
is no query field. If there is a `?` but no query, the query field exists
24179-
with an empty string. The `exists` query can be used to differentiate between
24180-
the two cases.'
24177+
If a URL contains no `?`, there is no query field. If there is a `?` but no
24178+
query, the query field exists with an empty string. The `exists` query can
24179+
be used to differentiate between the two cases.'
24180+
example: q=elasticsearch&sort=desc
2418124181
flat_name: threat.enrichments.indicator.url.query
2418224182
ignore_above: 2083
2418324183
level: extended
@@ -26978,13 +26978,13 @@ threat:
2697826978
type: long
2697926979
threat.indicator.url.query:
2698026980
dashed_name: threat-indicator-url-query
26981-
description: 'The query field describes the query string of the request, such
26982-
as "q=elasticsearch".
26981+
description: 'The field contains the entire query string, excluding the leading
26982+
`?` character, such as "q=elasticsearch".
2698326983

26984-
The `?` is excluded from the query string. If a URL contains no `?`, there
26985-
is no query field. If there is a `?` but no query, the query field exists
26986-
with an empty string. The `exists` query can be used to differentiate between
26987-
the two cases.'
26984+
If a URL contains no `?`, there is no query field. If there is a `?` but no
26985+
query, the query field exists with an empty string. The `exists` query can
26986+
be used to differentiate between the two cases.'
26987+
example: q=elasticsearch&sort=desc
2698826988
flat_name: threat.indicator.url.query
2698926989
ignore_above: 2083
2699026990
level: extended
@@ -28949,13 +28949,13 @@ url:
2894928949
type: long
2895028950
url.query:
2895128951
dashed_name: url-query
28952-
description: 'The query field describes the query string of the request, such
28953-
as "q=elasticsearch".
28952+
description: 'The field contains the entire query string, excluding the leading
28953+
`?` character, such as "q=elasticsearch".
2895428954

28955-
The `?` is excluded from the query string. If a URL contains no `?`, there
28956-
is no query field. If there is a `?` but no query, the query field exists
28957-
with an empty string. The `exists` query can be used to differentiate between
28958-
the two cases.'
28955+
If a URL contains no `?`, there is no query field. If there is a `?` but no
28956+
query, the query field exists with an empty string. The `exists` query can
28957+
be used to differentiate between the two cases.'
28958+
example: q=elasticsearch&sort=desc
2895928959
flat_name: url.query
2896028960
ignore_above: 2083
2896128961
level: extended

generated/beats/fields.ecs.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12335,13 +12335,13 @@
1233512335
level: extended
1233612336
type: keyword
1233712337
ignore_above: 2083
12338-
description: 'The query field describes the query string of the request, such
12339-
as "q=elasticsearch".
12338+
description: 'The field contains the entire query string, excluding the leading
12339+
`?` character, such as "q=elasticsearch".
1234012340

12341-
The `?` is excluded from the query string. If a URL contains no `?`, there
12342-
is no query field. If there is a `?` but no query, the query field exists
12343-
with an empty string. The `exists` query can be used to differentiate between
12344-
the two cases.'
12341+
If a URL contains no `?`, there is no query field. If there is a `?` but no
12342+
query, the query field exists with an empty string. The `exists` query can
12343+
be used to differentiate between the two cases.'
12344+
example: q=elasticsearch&sort=desc
1234512345
default_field: false
1234612346
- name: enrichments.indicator.url.registered_domain
1234712347
level: extended
@@ -13995,13 +13995,13 @@
1399513995
level: extended
1399613996
type: keyword
1399713997
ignore_above: 2083
13998-
description: 'The query field describes the query string of the request, such
13999-
as "q=elasticsearch".
13998+
description: 'The field contains the entire query string, excluding the leading
13999+
`?` character, such as "q=elasticsearch".
1400014000

14001-
The `?` is excluded from the query string. If a URL contains no `?`, there
14002-
is no query field. If there is a `?` but no query, the query field exists
14003-
with an empty string. The `exists` query can be used to differentiate between
14004-
the two cases.'
14001+
If a URL contains no `?`, there is no query field. If there is a `?` but no
14002+
query, the query field exists with an empty string. The `exists` query can
14003+
be used to differentiate between the two cases.'
14004+
example: q=elasticsearch&sort=desc
1400514005
default_field: false
1400614006
- name: indicator.url.registered_domain
1400714007
level: extended
@@ -15064,13 +15064,13 @@
1506415064
level: extended
1506515065
type: keyword
1506615066
ignore_above: 2083
15067-
description: 'The query field describes the query string of the request, such
15068-
as "q=elasticsearch".
15067+
description: 'The field contains the entire query string, excluding the leading
15068+
`?` character, such as "q=elasticsearch".
1506915069

15070-
The `?` is excluded from the query string. If a URL contains no `?`, there
15071-
is no query field. If there is a `?` but no query, the query field exists
15072-
with an empty string. The `exists` query can be used to differentiate between
15073-
the two cases.'
15070+
If a URL contains no `?`, there is no query field. If there is a `?` but no
15071+
query, the query field exists with an empty string. The `exists` query can
15072+
be used to differentiate between the two cases.'
15073+
example: q=elasticsearch&sort=desc
1507415074
- name: registered_domain
1507515075
level: extended
1507615076
type: keyword

0 commit comments

Comments
 (0)