# While reindexing can I add geoip info to a record

**URL:** <https://discuss.elastic.co/t/while-reindexing-can-i-add-geoip-info-to-a-record/256396>\
**Category:** Elasticsearch\
**Created:** [November 23, 2020, 7:54pm UTC](https://discuss.elastic.co/t/while-reindexing-can-i-add-geoip-info-to-a-record/256396 "2020-11-23T19:54:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Russell\_Fulton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/russell_fulton/32/62888_2.png) [@Russell\_Fulton](https://discuss.elastic.co/u/Russell_Fulton)\
**Post date:** [November 23, 2020, 7:54pm UTC](https://discuss.elastic.co/t/while-reindexing-can-i-add-geoip-info-to-a-record/256396/1 "2020-11-23T19:54:15Z")

</div>

I am using a script to tidy up old indexes and get all the data consistent. Later indexes have geoip information for ip addresses but older ones don't.

I can't figure out how to explicitly invoke a geoip lookup in a script and then assign the some of the fields returned to fields in the mapping.

The older indexes have a text field for the ip the later ones have a different field name and ip type so the first thing I will do assign `src_ip = ip`.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 23, 2020, 7:57pm UTC](https://discuss.elastic.co/t/while-reindexing-can-i-add-geoip-info-to-a-record/256396/2 "2020-11-23T19:57:12Z")

</div>

Why not use an ingest pipeline with a [geoip processor](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/geoip-processor.html) when you reindex?

---

<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:** [December 21, 2020, 7:57pm UTC](https://discuss.elastic.co/t/while-reindexing-can-i-add-geoip-info-to-a-record/256396/3 "2020-12-21T19:57:40Z")

</div>

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