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