# Appending a result from a search to the result of another search

**URL:** <https://discuss.elastic.co/t/appending-a-result-from-a-search-to-the-result-of-another-search/291956>\
**Category:** Kibana\
**Created:** [December 15, 2021, 11:02am UTC](https://discuss.elastic.co/t/appending-a-result-from-a-search-to-the-result-of-another-search/291956 "2021-12-15T11:02:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![perbejder](https://avatars.discourse-cdn.com/v4/letter/p/c5a1d2/32.png) [@perbejder](https://discuss.elastic.co/u/perbejder)\
**Post date:** [December 15, 2021, 11:02am UTC](https://discuss.elastic.co/t/appending-a-result-from-a-search-to-the-result-of-another-search/291956/1 "2021-12-15T11:02:02Z")

</div>

Hi

I have two indexes.  
One with data from our Windows servers and another with information from our CMDB.

I want to make a count of servers that have send data to Elastic within the last 24 hours from the Windows index and divide that count with a count of servers in the CMDB index

Something like _((Count of active servers in Windows index / Count of Servers from CMDB) \* 100) = “% of know servers that did send data”_

I haven’t found any way to do it in Kibana, but being new to Elastic there might be other ways to this.

Best regards  
Per Bejder

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [December 15, 2021, 11:51am UTC](https://discuss.elastic.co/t/appending-a-result-from-a-search-to-the-result-of-another-search/291956/2 "2021-12-15T11:51:07Z")

</div>

You can create an index pattern which includes both indices (`windows-data,cmdb-data`), then create a visualization which filters on the `_index` field). You can calculate the ratio using Lens formula: [Create visualizations with Lens | Kibana Guide [7.16] | Elastic](https://www.elastic.co/guide/en/kibana/current/lens.html#lens-formulas)

`unique_count(server.id, kql="_index:windows-data")/unique_count(server.id, kql="_index:cmdb-data")`

---

<div class="post-metadata">

**Author:** ![perbejder](https://avatars.discourse-cdn.com/v4/letter/p/c5a1d2/32.png) [@perbejder](https://discuss.elastic.co/u/perbejder)\
**Post date:** [December 15, 2021, 12:10pm UTC](https://discuss.elastic.co/t/appending-a-result-from-a-search-to-the-result-of-another-search/291956/3 "2021-12-15T12:10:56Z")

</div>

Thanks - I will test that

---

<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 12, 2022, 12:11pm UTC](https://discuss.elastic.co/t/appending-a-result-from-a-search-to-the-result-of-another-search/291956/4 "2022-01-12T12:11:54Z")

</div>

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