# Read an index and count in other index

**URL:** <https://discuss.elastic.co/t/read-an-index-and-count-in-other-index/337803>\
**Category:** Logstash\
**Created:** [July 6, 2023, 2:00pm UTC](https://discuss.elastic.co/t/read-an-index-and-count-in-other-index/337803 "2023-07-06T14:00:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![reed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/reed/32/122863_2.png) [@reed](https://discuss.elastic.co/u/reed)\
**Post date:** [July 6, 2023, 2:00pm UTC](https://discuss.elastic.co/t/read-an-index-and-count-in-other-index/337803/1 "2023-07-06T14:00:43Z")

</div>

Hi all,

I have two index:

**index\_master**

```auto
name - code
m1 - c1
m2 - c2
m3 - c3

```

**index\_details**

```auto
code - other fields
c1 - data field
c1 - data field
c1 - data field
c1 - data field
c2 - data field
c2 - data field
c2 - data field
c3 - data field
c3 - data field

```

in a pipeline I need to read from input the index\_master but in the filter I need to perform a count of the documents in the index\_details using as parameter the field "code" of the index\_master and index\_details.

So far I've searched for all filters plugin and with ruby filter but can't find a solution that fit my needs.

Someone can help me with this problem?

thanks in advance  
diego

---

<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:** [August 3, 2023, 2:00pm UTC](https://discuss.elastic.co/t/read-an-index-and-count-in-other-index/337803/2 "2023-08-03T14:00:50Z")

</div>

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