# Uri\_parts Ingest Processor - domain field

**URL:** <https://discuss.elastic.co/t/uri-parts-ingest-processor-domain-field/300139>\
**Category:** Elasticsearch\
**Tags:** ingest-pipeline\
**Created:** [March 20, 2022, 6:39pm UTC](https://discuss.elastic.co/t/uri-parts-ingest-processor-domain-field/300139 "2022-03-20T18:39:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sera123k](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@sera123k](https://discuss.elastic.co/u/sera123k)\
**Post date:** [March 20, 2022, 6:39pm UTC](https://discuss.elastic.co/t/uri-parts-ingest-processor-domain-field/300139/1 "2022-03-20T18:39:37Z")

</div>

I'm working with the Zscaler integration and noticed that when passing the logs through the pipeline the uri\_parts ingest processor does not create url.domain out of the URL that Zscaler sends based off the test logs from the [repo](https://github.com/elastic/integrations/blob/main/packages/zscaler_zia/data_stream/web/_dev/test/pipeline/test-web.log).

I built a pipeline to just test the uri\_parts processor and it seems that not including a scheme is the cause for not populating the domain, so adding https:// to the URL will then populate url.domain. My question then, **is this expected behavior**? Zscaler does not send the scheme with the URL and while it probably isn't that big a deal to modify the pipeline, I'm trying to keep it as close to vanilla so upgrading the integration is simple. Sample outputs below:

```auto
## Sample without scheme
POST _ingest/pipeline/_simulate
{
  "pipeline": {
    "description": "test uri_parts",
    "processors": [
      {
        "uri_parts" : {
          "field" : "message"
        }
      }
    ]
  },
  "docs":[
    {
      "_source":{
        "message":"www.example.com/testpath/index.php?user=joe"
      }
    }
  ]
}

{
  "docs" : [
    {
      "doc" : {
        "_index" : "_index",
        "_id" : "_id",
        "_source" : {
          "message" : "www.example.com/testpath/index.php?user=joe",
          "url" : {
            "path" : "www.example.com/testpath/index.php",
            "extension" : "php",
            "original" : "www.example.com/testpath/index.php?user=joe",
            "scheme" : null,
            "domain" : null,
            "query" : "user=joe"
          }
        },
        "_ingest" : {
          "timestamp" : "2022-03-20T18:35:01.534115808Z"
        }
      }
    }
  ]
}

## Sample with scheme
POST _ingest/pipeline/_simulate
{
  "pipeline": {
    "description": "test uri_parts",
    "processors": [
      {
        "uri_parts" : {
          "field" : "message"
        }
      }
    ]
  },
  "docs":[
    {
      "_source":{
        "message":"https://www.example.com/testpath/index.php?user=joe"
      }
    }
  ]
}

{
  "docs" : [
    {
      "doc" : {
        "_index" : "_index",
        "_id" : "_id",
        "_source" : {
          "message" : "https://www.example.com/testpath/index.php?user=joe",
          "url" : {
            "path" : "/testpath/index.php",
            "extension" : "php",
            "original" : "https://www.example.com/testpath/index.php?user=joe",
            "scheme" : "https",
            "domain" : "www.example.com",
            "query" : "user=joe"
          }
        },
        "_ingest" : {
          "timestamp" : "2022-03-20T18:35:13.970828081Z"
        }
      }
    }
  ]
}

```

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 21, 2022, 8:23am UTC](https://discuss.elastic.co/t/uri-parts-ingest-processor-domain-field/300139/2 "2022-03-21T08:23:40Z")

</div>

Hey,

so my assumption here is, that in order to be a valid URI the schema/protocol like `http://` or `https://` is missing.

Please open an issue in [Issues · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues) for a feature request for this.

--Alex

---

<div class="post-metadata">

**Author:** ![sera123k](https://avatars.discourse-cdn.com/v4/letter/s/3d9bf3/32.png) [@sera123k](https://discuss.elastic.co/u/sera123k)\
**Post date:** [March 21, 2022, 1:51pm UTC](https://discuss.elastic.co/t/uri-parts-ingest-processor-domain-field/300139/3 "2022-03-21T13:51:48Z")

</div>

Thanks, created [Update uri\_parts processor to extract domain without a prefix/scheme · Issue #85161 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/85161)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 18, 2022, 1:52pm UTC](https://discuss.elastic.co/t/uri-parts-ingest-processor-domain-field/300139/4 "2022-04-18T13:52:45Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
