Splunk Search

Create table for exception without key-value pair

shilpi
New Member

I am new to Splunk.

I need to search my logs for any Exception (FileNotFoundException in below example) and then populate the data in a table with 2 columns- host and the exception. The exception is not in key-value format. A sample of my log file is-

2011-06-24 13:29:39,453 [J353454535 c:1.5.7.88] INFO  (MyClass.java:78) - FileNotFoundException
host=myhost.google.com   Options|  sourcetype=My_log4j   
Tags (1)
0 Karma

MHibbin
Influencer

You should look at creating your fields first:

http://docs.splunk.com/Documentation/Splunk/5.0.3/Knowledge/Addfieldsatsearchtime

However the following should (I think) provide what you require (assuming the format is always the same for exceptions):

<yourBaseSearch>
| rex field=_raw "\-\s+(?P<exception>\w+)"
| table host exception

In the above I just use rex to extract the field on the fly.

Hope this helps.

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...