# Writing events to different indexes through a variable

**URL:** https://discuss.elastic.co/t/writing-events-to-different-indexes-through-a-variable/316814
**Category:** Logstash
**Created:** [October 17, 2022, 4:26pm UTC](https://discuss.elastic.co/t/writing-events-to-different-indexes-through-a-variable/316814 "2022-10-17T16:26:49Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![Aleksei](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@Aleksei](https://discuss.elastic.co/u/Aleksei)
#### Post date: [October 17, 2022, 8:40pm UTC](https://discuss.elastic.co/t/writing-events-to-different-indexes-through-a-variable/316814/7 "2022-10-17T20:40:25Z")

</div>

Cooool 🙂  
This is how it works !  
Thanks !

I'm sorry, can I ask one more of my old branches [Painless script - counting equal values in a field](https://discuss.elastic.co/t/painless-script-counting-equal-values-in-a-field/316252) ?  
Maybe you know painless script well

---

_[View the full topic](https://discuss.elastic.co/t/writing-events-to-different-indexes-through-a-variable/316814)._
