# Dataset of IP's to query against Index

**URL:** <https://discuss.elastic.co/t/dataset-of-ips-to-query-against-index/253056>\
**Category:** Elasticsearch\
**Created:** [October 22, 2020, 6:58pm UTC](https://discuss.elastic.co/t/dataset-of-ips-to-query-against-index/253056 "2020-10-22T18:58:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichaelHuff](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaelhuff/32/77965_2.png) [@MichaelHuff](https://discuss.elastic.co/u/MichaelHuff)\
**Post date:** [October 22, 2020, 6:58pm UTC](https://discuss.elastic.co/t/dataset-of-ips-to-query-against-index/253056/1 "2020-10-22T18:58:08Z")

</div>

I have a data set of around 40k of IP Addresses that are known bad IP's. I am wanting to query that data set against an index in my stack. When I query the data I wanna bring back any specific username that has had a successful login from one of the IP's listed in the Data Set.

---

<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:** [October 26, 2020, 9:23am UTC](https://discuss.elastic.co/t/dataset-of-ips-to-query-against-index/253056/2 "2020-10-26T09:23:35Z")

</div>

Have you considered doing this at index time using the [enrich processor](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/ingest-enriching-data.html)?

---

<div class="post-metadata">

**Author:** ![MichaelHuff](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaelhuff/32/77965_2.png) [@MichaelHuff](https://discuss.elastic.co/u/MichaelHuff)\
**Post date:** [October 26, 2020, 11:28am UTC](https://discuss.elastic.co/t/dataset-of-ips-to-query-against-index/253056/3 "2020-10-26T11:28:00Z")

</div>

@spinscale, thank you for the information. while this is good information for moving forward, it however does not help me with data that is already indexed. That is the issue I am currently running into. The IPs are in a txt file and not an index in my stack currently.

Thanks again,

---

<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:** [October 26, 2020, 12:22pm UTC](https://discuss.elastic.co/t/dataset-of-ips-to-query-against-index/253056/4 "2020-10-26T12:22:19Z")

</div>

This is not quite true, as you could run an [update-by-query](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/docs-update-by-query.html) with a special pipeline that is doing the enrichment.

However you indeed need to find a mechanism to index those ip addresses.

---

<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:** [November 23, 2020, 12:22pm UTC](https://discuss.elastic.co/t/dataset-of-ips-to-query-against-index/253056/5 "2020-11-23T12:22:31Z")

</div>

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