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!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

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

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 ...