Getting Data In

Forward messages to different indexes based on the value of its field

myordanov95
Engager

Is it possible to forward messages to different indexes based on the value of message field ?
And which forwarder is the most appropriate (Universal or Heavy) ?

Tags (1)
0 Karma

sudosplunk
Motivator

Yes. Using props.conf and transforms.conf, you can achieve this. Please provide some sample data to perform regex matching. Otherwise, below is the basic structure of configuration settings for routing events.

Props.conf:

[your_custom_sourcetype]
TRANSFORMS-routing = routing_based_on_field_values

Transforms.conf:

[routing_based_on_field_values]
REGEX = <your_custom_regex>
DEST_KEY = _MetaData:Index
FORMAT = <alternate_index_name>

You can find more information in below links, let me know if this helps.

http://docs.splunk.com/Documentation/Splunk/7.1.2/Indexer/Setupmultipleindexes#Route_specific_events...

https://answers.splunk.com/answers/566448/route-specific-events-to-a-relative-index.html

myordanov95
Engager

In case of having a thousands of different values , I want to create thousands of indexes. Does it mean I have to declared thousands of stanzas.

0 Karma

sudosplunk
Motivator

Oh, you want to route each event with different value to a different index? I thought, you want to look for specific value in the raw events and route all the events which have this specific value to different index(s).

0 Karma

myordanov95
Engager

Yes, I want to forward events with different value to a different indexes.

0 Karma

sudosplunk
Motivator

Can you provide some sample events with values which you want to route.

0 Karma

myordanov95
Engager

{"name":"value1"},
{"name":"value2"},
....
{"name":"value1000"}

In this case, I want to forward events to 1000 indexes.

0 Karma

sudosplunk
Motivator

Are all these events coming from 1 source/host? Also, why do you want to forward each event to each index.

0 Karma

myordanov95
Engager

Sorry, I am looking for solution of this problem.

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

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

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...