Getting Data In

How do I route events into different indexes based on event type?

nawneel
Communicator

I have an indexing scenario and below are the points to be considered. Imagine I have log file with DEBUG, INFO, and ERROR events .

  1. Need to filter out events with INFO using nullQueue (feasible)
  2. DEBUG and ERROR events need to go to DEBUGINDEX and ERRORINDEX respectively (is this feasible?)

Is the second scenario feasible, and if so, how?

I have my data flowing from a universal forwarder to an indexer via heavy forwarder.

1 Solution

javiergn
SplunkTrust
SplunkTrust

Question 2


Universal Forwarder

inputs.conf

[monitor://path to your file]
sourcetype = mysourcetype
other props ...

Indexer or Heavy Forwarder

props.conf

[mysourcetype]
TRANSFORMS-newindex = index2debug, index2error

transforms.conf

[index2debug]
DEST_KEY =_MetaData:Index
REGEX = something that matches DEBUG lines
FORMAT = debugindex

 [index2error]
DEST_KEY =_MetaData:Index
REGEX = something that matches ERROR lines
FORMAT = errorindex

Keep in mind you can also override your index name dynamically if you capture the final value in your REGEX and then you use something like "index::$1" in your FORMAT line.

Some official documentation here: http://docs.splunk.com/Documentation/Splunk/6.3.2/Data/Advancedsourcetypeoverrides

Hope that helps.

View solution in original post

javiergn
SplunkTrust
SplunkTrust

Question 2


Universal Forwarder

inputs.conf

[monitor://path to your file]
sourcetype = mysourcetype
other props ...

Indexer or Heavy Forwarder

props.conf

[mysourcetype]
TRANSFORMS-newindex = index2debug, index2error

transforms.conf

[index2debug]
DEST_KEY =_MetaData:Index
REGEX = something that matches DEBUG lines
FORMAT = debugindex

 [index2error]
DEST_KEY =_MetaData:Index
REGEX = something that matches ERROR lines
FORMAT = errorindex

Keep in mind you can also override your index name dynamically if you capture the final value in your REGEX and then you use something like "index::$1" in your FORMAT line.

Some official documentation here: http://docs.splunk.com/Documentation/Splunk/6.3.2/Data/Advancedsourcetypeoverrides

Hope that helps.

dgrubb_splunk
Splunk Employee
Splunk Employee

For Question 1. You can use the Discard Specific events and keep the rest configuration in the Admin manual:

http://docs.splunk.com/Documentation/Splunk/4.1/Admin/Routeandfilterdata#Filter_event_data_and_send_...

0 Karma

nawneel
Communicator

this is feasible and i completely understand it

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Updates (ESCU) - New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 3 releases of new content via the Enterprise ...

Thought Leaders are Validating Your Hard Work and Training Rigor

As a Splunk enthusiast and member of the Splunk Community, you are one of thousands who recognize the value of ...

.conf23 Registration is Now Open!

Time to toss the .conf-etti 🎉 —  .conf23 registration is open!   Join us in Las Vegas July 17-20 for ...