# Logstash filter code that sends a query to related indices by wild card \[indexname-\*\]

**URL:** <https://discuss.elastic.co/t/logstash-filter-code-that-sends-a-query-to-related-indices-by-wild-card-indexname/321718>\
**Category:** Logstash\
**Created:** [December 21, 2022, 5:54am UTC](https://discuss.elastic.co/t/logstash-filter-code-that-sends-a-query-to-related-indices-by-wild-card-indexname/321718 "2022-12-21T05:54:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PRASHANT\_MEHTA](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prashant_mehta/32/101764_2.png) [@PRASHANT\_MEHTA](https://discuss.elastic.co/u/PRASHANT_MEHTA)\
**Post date:** [December 21, 2022, 5:54am UTC](https://discuss.elastic.co/t/logstash-filter-code-that-sends-a-query-to-related-indices-by-wild-card-indexname/321718/1 "2022-12-21T05:54:50Z")

</div>

Hello All,

Can someone please help me out how can I write custom filter in logstash to achieve the following:

Making a custom logstash filter that sends a query to related indices by wild card (indexname-\*) for records with that(Unique id present in all rollover index) `_id` and if there are existing ones and not belongs to current day's index, it will remove them and insert the current event to **current rollover index** instead.

I want to do update/delete operation on my indices data.

I would also like to understand will it slowdown logstash events processing to logstash if above is applied?, Surely it will slow down I suppose.

Many Thanx

---

<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:** [January 18, 2023, 5:54am UTC](https://discuss.elastic.co/t/logstash-filter-code-that-sends-a-query-to-related-indices-by-wild-card-indexname/321718/2 "2023-01-18T05:54:53Z")

</div>

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