# Simple Anomaly Detection Question

**URL:** <https://discuss.elastic.co/t/simple-anomaly-detection-question/339580>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [July 28, 2023, 7:00pm UTC](https://discuss.elastic.co/t/simple-anomaly-detection-question/339580 "2023-07-28T19:00:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![McJava1967](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@McJava1967](https://discuss.elastic.co/u/McJava1967)\
**Post date:** [July 28, 2023, 7:00pm UTC](https://discuss.elastic.co/t/simple-anomaly-detection-question/339580/1 "2023-07-28T19:00:34Z")

</div>

Hi all. I'm a newbie at Anomaly Detection. Let's say I have a key, "PET", with two possible values, "CAT" and "DOG". I want to detect when there are an unusual number of CATs in an hour. Is that possible?

I thought Multi-Metric, split by PET, would do it. But that doesn't seem to be the case. It seems to combine the results of independent CAT and DOG analyses. I just want CAT.

If I just select "count (event rate)" in Single Metric, it runs against **all** records in the index. And the only Metric available for PET is **distinct** count, which will always be 1 or 2.

I know I must be missing something! Help!

🙂

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [July 29, 2023, 1:01am UTC](https://discuss.elastic.co/t/simple-anomaly-detection-question/339580/2 "2023-07-29T01:01:04Z")

</div>

You can do a single metric with a term / KQL filter on CAT.

Multi-metric split on PET on count should work as well multi metric treats each entity as its own model.

---

<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 26, 2023, 1:01am UTC](https://discuss.elastic.co/t/simple-anomaly-detection-question/339580/3 "2023-08-26T01:01:09Z")

</div>

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