How to group the documents which have subset of similar values

I have error table which logs all the errors.

I want to group all similar errors and exceptions.

Few are straight forward, example,

Document 1 , Error Message - Database mark down

Document 2 , Error Message - Service Mark Down

Document 3, Error Message - Database mark down

Document 4, Error Message - Service Mark Down

Document 5, Error Message - Service Mark Down

In the above example, Document 1 and Document 3 are grouped into one category.

Document 2,4,5 are grouped into one category.

Let's take an another example (which i am having problem in grouping),

Document 6, Error Message - 1121 Data locked for account no 123456789

Document 7, Error Message - 1121 Data locked for account no 438192303

Document 8, Error Message - 1121 Data locked for account no 678976543

For above example even though all belongs to Data locked issue, I am not able to group them into same category in the Kibana Visualization.