Splunk Search

A tabular report on list of unique exceptions and # of occurrences

vincenty
Explorer

Hi I'm new to splunk.
I want to search "exception" over a lot of different types of log files with a return of a tabular report on list of unique exceptions and # of occurrences.

I tried to do this:
exception | dedup source | timechart count by source

this will give me a time chart... how do I get this in a pie chart?

Tags (1)
0 Karma

parameshjava
Explorer

earliest=-7d source=".log" | rex "(?\w*Exception)" | chart count by exception usenull=f useother=f | sort count

Once results generated click on Visualization tab --> Select Pie in left menu.
Here,
earliest=-7d --> for last 7 days
source=".log" --> To search in a specific file
rex "(?\w*Exception)" --> To extract all exceptions, use (?:\w+.)+\w* instead of \w* for fully qualified exception name
chart count by exception --> to generate chart
usenull=f useother=f --> To avoid NULL and OTHER

Pie Chart

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Replace timechart with chart, set visualization to pie.

rsennett_splunk
Splunk Employee
Splunk Employee

All of these concepts are covered nicely in the tutorial. You might want to run through that so you'll more easily see how to organize things for your needs. It's quite fun and doesn't take long.

http://docs.splunk.com/Documentation/Splunk/latest/Tutorial/WelcometotheSplunktutorial

With Splunk... the answer is always "YES!". It just might require more regex than you're prepared for!
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

For that you first need to extract your exception string into a field, see http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Aboutfields

0 Karma

vincenty
Explorer

There can be different exceptions appears in a log file: SQLException, MessagingException, IOException, etc.

As well as in different log file types: *.log, *.out

I would like to get both a tabular report and a pie chart for them. A tabular report list the number of each unique occurrences of the "exception" type, and its corresponding logfile type (a.log, b.out, c.log...)

A pie chart to show the top exceptions.

May be for a day, 7 day,... does this make sense?

0 Karma
Get Updates on the Splunk Community!

Index This | When is October more than just the tenth month?

October 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What’s New & Next in Splunk SOAR

 Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us for an ...