registered-domain.asciidoc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. [role="xpack"]
  2. [[registered-domain-processor]]
  3. === Registered domain processor
  4. ++++
  5. <titleabbrev>Registered domain</titleabbrev>
  6. ++++
  7. Extracts the registered domain (also known as the effective top-level domain or
  8. eTLD), sub-domain, and top-level domain from a fully qualified domain name
  9. (FQDN). Uses the registered domains defined in the
  10. https://publicsuffix.org/[Mozilla Public Suffix List].
  11. [[registered-domain-options]]
  12. .Registered Domain Options
  13. [options="header"]
  14. |======
  15. | Name | Required | Default | Description
  16. | `field` | yes | | Field containing the source FQDN.
  17. | `target_field` | no | `<empty string>` | Object field containing
  18. extracted domain components. If an `<empty string>`, the processor adds
  19. components to the document's root.
  20. | `ignore_missing` | no | `true` | If `true` and any required fields
  21. are missing, the processor quietly exits without modifying the document.
  22. include::common-options.asciidoc[]
  23. |======
  24. [discrete]
  25. [[registered-domain-processor-ex]]
  26. ===== Examples
  27. The following example illustrates the use of the registered domain processor:
  28. [source,console]
  29. ----
  30. POST _ingest/pipeline/_simulate
  31. {
  32. "pipeline": {
  33. "processors": [
  34. {
  35. "registered_domain": {
  36. "field": "fqdn",
  37. "target_field": "url"
  38. }
  39. }
  40. ]
  41. },
  42. "docs": [
  43. {
  44. "_source": {
  45. "fqdn": "www.example.ac.uk"
  46. }
  47. }
  48. ]
  49. }
  50. ----
  51. Which produces the following result:
  52. [source,console-result]
  53. ----
  54. {
  55. "docs": [
  56. {
  57. "doc": {
  58. ...
  59. "_source": {
  60. "fqdn": "www.example.ac.uk",
  61. "url": {
  62. "subdomain": "www",
  63. "registered_domain": "example.ac.uk",
  64. "top_level_domain": "ac.uk",
  65. "domain": "www.example.ac.uk"
  66. }
  67. }
  68. }
  69. }
  70. ]
  71. }
  72. ----
  73. // TESTRESPONSE[s/\.\.\./"_index":"_index","_id":"_id","_version":"-3","_ingest":{"timestamp":$body.docs.0.doc._ingest.timestamp},/]