Skip to content

geoip processor adds _geoip_database_unavailable_* tag to docs with missing source field #87345

@axw

Description

@axw

Elasticsearch Version

8.13.0-SNAPSHOT

Installed Plugins

No response

Java Version

18

OS Version

Linux (Docker)

Problem Description

The geoip ingest processor adds a _geoip_database_unavailable_* tag field to documents when the database cannot be downloaded, even if the source field does not exist and ignore_missing is set.

Steps to Reproduce

  1. Run Elasticsearch with ingest.geoip.downloader.enabled=false
  2. Execute the following request in the console:
POST /_ingest/pipeline/_simulate
{
  "pipeline": {
    "processors": [
      {
        "geoip": {
          "field": "client.ip",
          "target_field": "client.geo",
          "ignore_missing": true
        }
      }
    ]
  },
  "docs": [
    {
      "_index": "index",
      "_source": {}
    },
    {
      "_index": "index",
      "_source": {"client": {"ip": "8.8.8.8"}}
    }
  ]
}

This produces:

{
  "docs" : [
    {
      "doc" : {
        "_index" : "index",
        "_id" : "_id",
        "_source" : {
          "tags" : [
            "_geoip_database_unavailable_GeoLite2-City.mmdb"
          ]
        },
        "_ingest" : {
          "timestamp" : "2022-06-03T02:33:16.49692803Z"
        }
      }
    },
    {
      "doc" : {
        "_index" : "index",
        "_id" : "_id",
        "_source" : {
          "client" : {
            "ip" : "8.8.8.8"
          },
          "tags" : [
            "_geoip_database_unavailable_GeoLite2-City.mmdb"
          ]
        },
        "_ingest" : {
          "timestamp" : "2022-06-03T02:33:16.496934873Z"
        }
      }
    }
  ]
}

I would expect only the second document to have the tag added.

Logs (if relevant)

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions