{"record":{"id":"a7e8757ad9eba128","repo":"elastic/elasticsearch","slug":"unable-to-set-domain-information-for-document","errorCode":null,"errorMessage":"unable to set domain information for document","messagePattern":"unable to set domain information for document","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/RegisteredDomainProcessor.java","lineNumber":60,"sourceCode":"    }\n\n    public boolean getIgnoreMissing() {\n        return ignoreMissing;\n    }\n\n    @Override\n    public IngestDocument execute(IngestDocument document) throws Exception {\n        final String fqdn = document.getFieldValue(field, String.class, ignoreMissing);\n        String fieldPrefix = targetField;\n        if (fieldPrefix.isEmpty() == false) {\n            fieldPrefix += \".\";\n        }\n        boolean infoFound = RegisteredDomain.parseRegisteredDomainInfo(\n            fqdn,\n            new IngestDocumentRegisteredDomainInfoCollector(document, fieldPrefix)\n        );\n        if (infoFound == false && ignoreMissing == false) {\n            throw new IllegalArgumentException(\"unable to set domain information for document\");\n        }\n        return document;\n    }\n\n    @Override\n    public String getType() {\n        return TYPE;\n    }\n\n    public static final class Factory implements Processor.Factory {\n\n        static final String DEFAULT_TARGET_FIELD = \"\";\n\n        @Override\n        public RegisteredDomainProcessor create(\n            Map<String, Processor.Factory> registry,\n            String tag,\n            String description,","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/RegisteredDomainProcessor.java#L42-L78","documentation":"Thrown by RegisteredDomainProcessor.execute when parsing the FQDN fails to extract registered domain information and ignoreMissing is false. The processor uses a public suffix list to determine the registered domain, subdomain, top-level domain, etc., and throws if the input cannot be parsed.","triggerScenarios":"Configuring the registered_domain processor on a field whose value is not a parseable hostname (e.g., an IP address, a bare TLD, an empty string, or malformed input), with ignore_missing set to false (the default).","commonSituations":"Pointing the processor at a field containing IP addresses instead of hostnames. Feeding internal hostnames without a public suffix. Data quality issues where the field contains free text or nulls.","solutions":["Set ignore_missing: true in the processor config to skip unparseable values instead of failing.","Pre-filter documents so only valid FQDNs reach this processor (e.g., via a conditional script).","Verify the source field actually contains hostname strings and not IPs or free text."],"exampleFix":"// before\n{\n  \"registered_domain\": { \"field\": \"host\" }\n}\n// after\n{\n  \"registered_domain\": { \"field\": \"host\", \"ignore_missing\": true }\n}","handlingStrategy":"validation","validationCode":"// Validate the field is a hostname-like string before registered_domain\nObject val = document.getFieldValue(\"fqdn\", Object.class, true);\nif (val == null || (val instanceof String s && s.matches(\"^[A-Za-z0-9.-]+$\") == false)) {\n    // skip or set ignore_missing: true\n}","typeGuard":"boolean isParseableHostname(String s) {\n    return s != null && !s.isBlank() && s.matches(\"^[A-Za-z0-9]([A-Za-z0-9.-]*[A-Za-z0-9])?$\") && s.contains(\".\");\n}","tryCatchPattern":"try {\n    // run registered_domain processor\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().equals(\"unable to set domain information for document\")) {\n        // set ignore_missing: true in config, or route to a fallback\n    } else { throw e; }\n}","preventionTips":["Set ignore_missing: true when the field may contain IPs or non-FQDN values.","Pre-filter documents so only valid hostnames reach the processor.","Use a conditional 'if' on the processor to check the field looks like a hostname."],"tags":["elasticsearch","ingest-pipeline","registered-domain","dns","validation"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T08:17:17.861Z"}