I have put all my logs into ELK. I want to classify my exceptions according to the exception type. Example: I want to classify the exceptions into "NullPointerException", "IndexOutOfBoundException",...
I have tried using the approach mentioned by @Val in the below previous question
match_only_text fields do not support sorting and aggregations elasticsearch
After following the steps mentioned by @Val using Kibana DevTools, I have created a filebeat scripted field using the script:
if (doc.containsKey('message.keyword'))
{ if(doc['message.keyword'].size()>0)
{
def message = doc['message.keyword'].value;
if (message.contains("java.lang.IllegalStateException"))
return "Error-1";
else
return "Error-2";
}
}
else
return "No Message";
It worked for the single line logs but didn't work for the multi-line logs. How can i make it work for the multi-line logs as well.
I will be glad if there is any better approach.