# Set IP address as index

**URL:** <https://discuss.elastic.co/t/set-ip-address-as-index/307642>\
**Category:** Logstash\
**Created:** [June 20, 2022, 11:48am UTC](https://discuss.elastic.co/t/set-ip-address-as-index/307642 "2022-06-20T11:48:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fropa](https://avatars.discourse-cdn.com/v4/letter/f/e68b1a/32.png) [@fropa](https://discuss.elastic.co/u/fropa)\
**Post date:** [June 20, 2022, 11:48am UTC](https://discuss.elastic.co/t/set-ip-address-as-index/307642/1 "2022-06-20T11:48:17Z")

</div>

Hi,

Can I configure logstash to set "source IP address" as index ? Is there any variable for that?

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [June 20, 2022, 3:39pm UTC](https://discuss.elastic.co/t/set-ip-address-as-index/307642/2 "2022-06-20T15:39:07Z")

</div>

If there is a field containing the source IP then you can use a sprintf reference in the index option. It is documented [here](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html).

---

<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:** [July 18, 2022, 3:39pm UTC](https://discuss.elastic.co/t/set-ip-address-as-index/307642/3 "2022-07-18T15:39:16Z")

</div>

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