# ML for unusual name detection

**URL:** <https://discuss.elastic.co/t/ml-for-unusual-name-detection/160951>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [December 14, 2018, 6:24pm UTC](https://discuss.elastic.co/t/ml-for-unusual-name-detection/160951 "2018-12-14T18:24:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kim-Kruse-Hansen](https://avatars.discourse-cdn.com/v4/letter/k/f1d935/32.png) [@Kim-Kruse-Hansen](https://discuss.elastic.co/u/Kim-Kruse-Hansen)\
**Post date:** [December 14, 2018, 6:24pm UTC](https://discuss.elastic.co/t/ml-for-unusual-name-detection/160951/1 "2018-12-14T18:24:01Z")

</div>

Hi

We are trying to find hostnames in the DHCP logs, that are roque in the sense that the hostname is not following current naming standards.

So I have been trying to figure out, how to do that with ML.

So I came up with an idea to collapse the hostname into patterns. So I preprocess all the names like this:

change all upper case chars to 'A',  
change all lowercase to 'a'  
change all digits to '0'  
all special char to '.'.

This gives a uniform pattern of the names.

I then used the rare function in a ML job to run through all the DHCP leases and I actually got some pretty decent results with this approach.

But is the correct way of detecting stuff like this or is there a simpler way , where I dont have to preprocess all the names myself ?

Best regards  
Kim

---

<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:** [December 14, 2018, 10:25pm UTC](https://discuss.elastic.co/t/ml-for-unusual-name-detection/160951/2 "2018-12-14T22:25:13Z")

</div>

Your approach is clever and is likely the best way to do it.

Kudos!

---

<div class="post-metadata">

**Author:** ![Kim-Kruse-Hansen](https://avatars.discourse-cdn.com/v4/letter/k/f1d935/32.png) [@Kim-Kruse-Hansen](https://discuss.elastic.co/u/Kim-Kruse-Hansen)\
**Post date:** [December 16, 2018, 11:57am UTC](https://discuss.elastic.co/t/ml-for-unusual-name-detection/160951/3 "2018-12-16T11:57:58Z")

</div>

Thanks Rich , appreciate it.

I am sure , some more recipes for stuff like this would be very welcomed by the community. We have many usecases, where we would like to try ML , but quite unsure on how to proceed.

Regards  
Kim

---

<div class="post-metadata">

**Author:** ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)\
**Post date:** [December 16, 2018, 7:15pm UTC](https://discuss.elastic.co/t/ml-for-unusual-name-detection/160951/4 "2018-12-16T19:15:41Z")

</div>

If your hostnames are following a fixed pattern could you not create a regex and used that in the ML job query? All that do not match would that not be rouge clients on the network..

I do like the use case..

---

<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 13, 2019, 7:15pm UTC](https://discuss.elastic.co/t/ml-for-unusual-name-detection/160951/5 "2019-01-13T19:15:48Z")

</div>

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