# Elastic search machine learning/ pattern recognition version 7.10.2

**URL:** <https://discuss.elastic.co/t/elastic-search-machine-learning-pattern-recognition-version-7-10-2/311202>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [August 2, 2022, 10:42am UTC](https://discuss.elastic.co/t/elastic-search-machine-learning-pattern-recognition-version-7-10-2/311202 "2022-08-02T10:42:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zain.jutt](https://avatars.discourse-cdn.com/v4/letter/z/49beb7/32.png) [@zain.jutt](https://discuss.elastic.co/u/zain.jutt)\
**Post date:** [August 2, 2022, 10:42am UTC](https://discuss.elastic.co/t/elastic-search-machine-learning-pattern-recognition-version-7-10-2/311202/1 "2022-08-02T10:42:35Z")

</div>

Hi, I have a question to find the root cause of a failed test. In 1st step, we have centralized the data in the Elasticsearch(7.10.2) index which contains the test id and the message(log event).  
For the failed tests to find the root cause I want to check if a few lines appear in the logs message for a specific test and if appear it should tell the reason for failure accordingly (ie. a custom failure message).

So for this, I want some directions, How can I achieve this? I am new to this topic. Looking forward to the feedback.  
Thank you.

---

<div class="post-metadata">

**Author:** ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)\
**Post date:** [August 3, 2022, 3:10pm UTC](https://discuss.elastic.co/t/elastic-search-machine-learning-pattern-recognition-version-7-10-2/311202/2 "2022-08-03T15:10:17Z")

</div>

It's not apparent here if you really need to use ML to analyze the logs or if you simply accomplish this with a search (i.e. search for the occurrence of the failed test, note the time and test id, then search in the logs for that test id and timeframe of the test failure).

---

<div class="post-metadata">

**Author:** ![zain.jutt](https://avatars.discourse-cdn.com/v4/letter/z/49beb7/32.png) [@zain.jutt](https://discuss.elastic.co/u/zain.jutt)\
**Post date:** [August 3, 2022, 3:54pm UTC](https://discuss.elastic.co/t/elastic-search-machine-learning-pattern-recognition-version-7-10-2/311202/3 "2022-08-03T15:54:21Z")

</div>

Thank you @richcollier for the reply. I want to use ML to analyze the logs. I can elaborate on it. I have 5 tests running and for each test after the execution, it sends logs to elastic search. When a test fails the logs belonging to that test need to be analyzed using ML to give a specific reason on GUI that why it failed.  
Each test pushes around 1000 events after success or failure and there are 5 to 6 or sometimes more events give very meaningful information about the failure so reading that I want to give the root cause for the failed test.  
so for that, I need directions to achieve it, I am very new to this topic. Thank you.

---

<div class="post-metadata">

**Author:** ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)\
**Post date:** [August 4, 2022, 12:11am UTC](https://discuss.elastic.co/t/elastic-search-machine-learning-pattern-recognition-version-7-10-2/311202/4 "2022-08-04T00:11:52Z")

</div>

You could investigate using [Categorization](https://youtu.be/wPd_JWWfre4) which allows you intelligent analysis of unstructured logs (if that's truly what you have). Keep in mind the video explains the concepts but the UI has changed slightly since the recording.

---

<div class="post-metadata">

**Author:** ![zain.jutt](https://avatars.discourse-cdn.com/v4/letter/z/49beb7/32.png) [@zain.jutt](https://discuss.elastic.co/u/zain.jutt)\
**Post date:** [August 5, 2022, 8:35am UTC](https://discuss.elastic.co/t/elastic-search-machine-learning-pattern-recognition-version-7-10-2/311202/5 "2022-08-05T08:35:41Z")

</div>

Thank you @richcollier that looks great, can you please also give some insight if it's the use case of elastic search (I mean is this possible) that reading the logs and giving the custom message root cause for the failed test? **I am using 7.10.2 version**.  
assuming that categorization is done and category 2 has all the FAIL events, so reading that predicts the failure reason?

---

<div class="post-metadata">

**Author:** ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)\
**Post date:** [August 5, 2022, 3:12pm UTC](https://discuss.elastic.co/t/elastic-search-machine-learning-pattern-recognition-version-7-10-2/311202/6 "2022-08-05T15:12:14Z")

</div>

Categorization wouldn't _conclude_ that a particular message type _caused_ the failure, it would show the user that at the time of the failure, which particular message types (categories) behaved differently than their historical behavior (i.e. a spike in the count of a certain message type or the sudden appearance of rarely seen message types that haven't been seen before).

Whether or not this solves what you want to accomplish remains to be seen.

---

<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:** [September 2, 2022, 3:13pm UTC](https://discuss.elastic.co/t/elastic-search-machine-learning-pattern-recognition-version-7-10-2/311202/7 "2022-09-02T15:13:12Z")

</div>

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