# Query to return missing value from known values

**URL:** <https://discuss.elastic.co/t/query-to-return-missing-value-from-known-values/155603>\
**Category:** Elasticsearch\
**Created:** [November 6, 2018, 7:10pm UTC](https://discuss.elastic.co/t/query-to-return-missing-value-from-known-values/155603 "2018-11-06T19:10:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryannelle](https://avatars.discourse-cdn.com/v4/letter/r/e56c9b/32.png) [@ryannelle](https://discuss.elastic.co/u/ryannelle)\
**Post date:** [November 6, 2018, 7:10pm UTC](https://discuss.elastic.co/t/query-to-return-missing-value-from-known-values/155603/1 "2018-11-06T19:10:31Z")

</div>

I have created a static custom index to hold the known hostnames of my machines and have the following items as shown below.

```auto
index: hosts
"hostname": ["betty", "bob", "fred"]
```

I want to query my index below with the hostnames from my index above and return any names not found.

```auto
index: logstash-*
"system.auth.hostname": "betty"
"system.auth.hostname": "bob"
```

My expected result would be to return the name **fred** since he wasn't found in the second index.

Any input would be appreciated. Thanks.

---

<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:** [December 4, 2018, 7:10pm UTC](https://discuss.elastic.co/t/query-to-return-missing-value-from-known-values/155603/2 "2018-12-04T19:10:36Z")

</div>

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