Splunk Search

Create table of exception

harishd
Explorer

Hi,

I have tried to list out all the tomcat exceptions from my application logs like this.

host="Tom1" sourcetype="out" | rex field=_raw "\b(?(java|javax).[\w.]+Exception)" | chart count by exception_type

However I am able to do this only for one single host. But I need something like this.

Exception                        host1          host2           host4 ......
java.net.exception                32             4               54
javax.nullpointerexception        34             56              34
java.netcommandException          34             34              22

How can I achieve this.

Regards,
Harish

Tags (3)
0 Karma
1 Solution

Ayn
Legend

Just add another by directive to chart:

sourcetype="out" 
| rex field=_raw "b(?<exception_type>(java|javax).[w.]+Exception)" 
| chart count by exception_type,host

View solution in original post

Ayn
Legend

Just add another by directive to chart:

sourcetype="out" 
| rex field=_raw "b(?<exception_type>(java|javax).[w.]+Exception)" 
| chart count by exception_type,host

dwaddle
SplunkTrust
SplunkTrust

If this answer solved your problem, please make sure to click the "accepted" check-mark next to it so it gets marked as "answered". Thanks.

harishd
Explorer

Cool thanks a lot.

splunk is really awesome and you guys too..

Regards,
Harish

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...