Replies: 1 comment
-
|
EDIT: I just found out about https://vector.dev/docs/reference/vrl/functions/#parse_etld which should actually be much simpler than all the rest I mentioned. Both should work but this is much simpler You could perform a lookup using an enrichment table. See https://vector.dev/guides/level-up/csv-enrichment-guide/ for an example. I recommend hard coding all TLDs in an object and using the get function. TLDs don't change that frequently. I personally use this file directly from IANA: https://data.iana.org/TLD/tlds-alpha-by-domain.txt. If you're using the Public Suffix List then hard coding might not be the best idea and an enrichment table would be better suited. This could also be useful for extracting the TLD itself without a regex: https://vector.dev/docs/reference/vrl/functions/#parse_url Also keep in mind that VRL is very efficient. Even a very suboptimal and inefficient |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Checking out Vector and it looks very nice. Did some basic testing. But I'm looking for a way to extract an TLD from a hostname with VRL. And I want to do it the smart way ... Using the Public Suffix List (PSl).
Is this somehow possible? A massive regexp if/else thingie does not looks very efficient.
Vector Config
No response
Vector Logs
No response
Beta Was this translation helpful? Give feedback.
All reactions