Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(vrl): add documentation for parse_etld function #19795

Merged
merged 5 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ downsides
downwardapi
emoji
esbuild
etld
fakeintake
fargate
fibonacci
Expand Down
66 changes: 66 additions & 0 deletions website/cue/reference/remap/functions/parse_etld.cue
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package metadata

remap: functions: parse_etld: {
category: "Parse"
description: """
Parses the [eTLD](\(urls.etld)) from `value` representing domain name.
"""

arguments: [
{
name: "value"
description: "The domain string."
required: true
type: ["string"]
},
{
name: "plus_parts"
description: """
Can be provided to get additional parts of the domain name. When 1 is passed,
eTLD+1 will be returned, which represents a domain registrable by a single
organization. Higher numbers will return subdomains.
"""
required: false
type: ["integer"]
default: false
},
]
internal_failure_reasons: []
return: types: ["object"]

examples: [
{
title: "Parse eTLD"
source: #"""
parse_etld!("sub.sussex.ac.uk")
"""#
return: {
etld: "ac.uk"
etld_plus: "ac.uk"
known_suffix: true
}
},
{
title: "Parse eTLD+1"
source: #"""
parse_etld!("sub.sussex.ac.uk", plus_parts: 1)
"""#
return: {
etld: "ac.uk"
etld_plus: "sussex.ac.uk"
known_suffix: true
}
},
{
title: "Parse eTLD with unknown suffix"
source: #"""
parse_etld!("vector.acmecorp")
"""#
return: {
etld: "acmecorp"
etld_plus: "acmecorp"
known_suffix: false
}
},
]
}
1 change: 1 addition & 0 deletions website/cue/reference/urls.cue
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ urls: {
endler_dev: "https://endler.dev/"
enrichment_tables_concept: "/docs/reference/glossary/#enrichment-tables"
eof: "\(wikipedia)/wiki/End-of-file#EOF_character"
etld: "https://developer.mozilla.org/en-US/docs/Glossary/eTLD"
etsy: "https://www.etsy.com"
event_proto: "\(vector_repo)/blob/master/lib/vector-core/proto/event.proto"
eventstoredb_stats_client: "https://developers.eventstore.com/server/v21.2/docs/diagnostics/stats.html"
Expand Down
Loading