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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...