# Finding frequently occuring logs to check heavy logging?

**URL:** <https://discuss.elastic.co/t/finding-frequently-occuring-logs-to-check-heavy-logging/357899>\
**Category:** Elasticsearch\
**Tags:** kql-kibana-query-language\
**Created:** [April 22, 2024, 9:49am UTC](https://discuss.elastic.co/t/finding-frequently-occuring-logs-to-check-heavy-logging/357899 "2024-04-22T09:49:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![t-e-x](https://avatars.discourse-cdn.com/v4/letter/t/edb3f5/32.png) [@t-e-x](https://discuss.elastic.co/u/t-e-x)\
**Post date:** [April 22, 2024, 9:49am UTC](https://discuss.elastic.co/t/finding-frequently-occuring-logs-to-check-heavy-logging/357899/1 "2024-04-22T09:49:51Z")

</div>

P.S - I need to find the top N log messages which are commonly occuring.

The reason I can't use 'term' aggregation is that the log message contain some different types of IDs in between them and that too many. So, it becomes the LCS [longest common subsequence] problem.

If the changing parameters were at start or end, I would have parsed or taken the substring in the script query.

So I was asking if there is any aggregation or technique elasticsearch has to tackle the above problem ?
