GeoIP enrichment

I am not seeing any ‘geo_location’ field in my elasticsearch sink I want to map it to elasticsearch’s geopoint. Do I need to setup something extra here. I have created a structured event.

"geo_region_name": null,"geo_longitude": null,"geo_latitude": null,"geo_zipcode": null,"geo_city": null,"geo_region": null,"geo_country": null,

Why are all these other fields null, am I missing some enrichment step in between?

Hi @shailesh17mar,

Did you set up the IP lookup enrichment which uses the MaxMInd database?

The documentation for that is here:

1 Like

@leon No I didn’t do that. I will set it up now. Does the geo_location field gets populated as well after this enrichment?
If yes, then that location is based on IP right? What I want to do is set geo_location field from android-tracker(If it’s possible then tell me how?).
Because I am running kind of gps tracker in the background which sends me current location in every 1-5 minutes.

I just want to setup a simple location object which could be easily be mapped to Elasticsearch geo_point. Do I have to create my own schema or is it possible without doing all that?

That’s the way to go:

  1. Create your schema with the lat/long in an Elasticsearch-friendly format
  2. Update your enriched events mapping in Elasticsearch to mark the lat/long within your entity as a geopoint

Hi, I am quite new to snowplow. I have set up the enrichment as mentioned here. https://github.com/snowplow/snowplow/wiki/IP-lookups-enrichment3

Still not seeing any data in geo_location field. The elasticsearch mapping is also not available for them. can you please help?

Hey Manju - do you have this enrichment schema in your enrichments/ folder?

You can also download a local copy of the maxmind db and update the uri.

Also, dont forget you need to restart your enrich tool (stream-enrich) to grab the new enrichment and/or clear the cache.

Are you using stream enrich?

./snowplow-stream-enrich --config my.config --resolver file:resolver.json --enrichments file:enrichments/ 
1 Like

Hi,

Thank you so much for responding to me. Yes, I do have that schema and I
restarted the machine to start collector, enrichment and elasticsearch.
Yes, I am using stream enrich. I also have downloaded a local copy and
hosting it in our own s3 bucket. There is also no mapping for enrichment
in elasticsearch. Kindly can you please help? Also let me know if you need
any further info.

Thanks,
Manju

Hi @manju!

Can you confirm that you have enabled: true in your config and schema is exactly iglu:com.snowplowanalytics.snowplow/ip_lookups/jsonschema/1-0-0 (these are most common mistakes)? Do you also have any other enrichments enabled?

Hi,

Again, thanks for the response. Yes I have enabled as “true”. But am not
sure what you mean by saying if this is exactly my schema. Sorry I’m
totally new to iglu server. Should I have iglu scala client running or just
hosing this schema in s3 should be good enough?
iglu:com.snowplowanalytics.snowplow/ip_lookups/jsonschema/1-0-0 My
resolver.json is the normal configuration provided in the snowplow site.
Are there specific steps to get the configured enrichments up and running?
I only need ip_lookups and none other.

Thanks,
Manju

Hi everyone,

Can you kindly help? I have uploaded the geolitecity.dat in our s3 bucket and this is my configuration in enrichments folder - ip_lookups.json

{
    "schema": "iglu:com.snowplowanalytics.snowplow/ip_lookups/jsonschema/1-0-0",
    "data": {

        "name": "ip_lookups",
        "vendor": "com.snowplowanalytics.snowplow",
        "enabled": true,
        "parameters": {
            "geo": {
                "database": "GeoLiteCity.dat",
                "uri": "url of geolitecity.dat"
            }
        }
    }
}

The geo location is not tracked. Pl. help.

Hey Snowplow team,

Could I use uri reference like file:///maxmind/ ?

{
	"schema": "iglu:com.snowplowanalytics.snowplow/ip_lookups/jsonschema/2-0-0",

	"data": {

		"name": "ip_lookups",
		"vendor": "com.snowplowanalytics.snowplow",
		"enabled": true,
		"parameters": {
			"geo": {
				"database": "GeoLite2-City.mmdb",
				"uri": "file:///maxmind"
			}
		}
	}
}


There is a local mode but currently it is only used for loading the resources for testing - rather than for production. The recommendation is to host on S3/GCS/HTTP URI rather than locally.

I got it! Thanks very much