Splunk Search

Unmatched regex re-routing

jadengoho
Builder

How can i route this kind of data to there proper index.

Data:

transaction_1

transaction_2

transaction_01 

transaction_02

transaction_11

transaction_12

 

Condition:

transaction_1 - transation_non_zero (index name)

transaction_2 - transation_non_zero

transaction_01  - transation_w_zero

transaction_02 - transation_w_zero

transaction_11 - global_unmatched_index

transaction_12 - global_unmatched_index

 

global_unmatched_index - is an index where all data that does not matched (transation_non_zero,transation_w_zero) indexes are located.

Also the requirement is to use props and transforms

Labels (1)
Tags (1)
1 Solution

inventsekar
SplunkTrust
SplunkTrust

FOR - 
transaction_1 - transation_non_zero (index name)

transaction_11 - global_unmatched_index

transaction_12 - global_unmatched_index

 

props.conf 

[default] 
TRANSFORMS-routing=unmatchedRouting

[host::testHost] TRANSFORMS-transation_non_zero = transation_non_zero_routing

transforms.conf 

[unmatchedRouting]
REGEX=(transaction\_1[1|2])
DEST_KEY=_TCP_ROUTING
FORMAT=unmatchedRouting

[transation_non_zero_routing] SOURCE_KEY = MetaData:testHost DEST_KEY = _MetaData:transation_non_zero REGEX = (transaction\_1) FORMAT = transation_non_zero_routing

https://docs.splunk.com/Documentation/Splunk/8.1.0/Forwarding/Routeandfilterdatad

 

 Best Regards,

Sekar

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !

View solution in original post

0 Karma

inventsekar
SplunkTrust
SplunkTrust

FOR - 
transaction_1 - transation_non_zero (index name)

transaction_11 - global_unmatched_index

transaction_12 - global_unmatched_index

 

props.conf 

[default] 
TRANSFORMS-routing=unmatchedRouting

[host::testHost] TRANSFORMS-transation_non_zero = transation_non_zero_routing

transforms.conf 

[unmatchedRouting]
REGEX=(transaction\_1[1|2])
DEST_KEY=_TCP_ROUTING
FORMAT=unmatchedRouting

[transation_non_zero_routing] SOURCE_KEY = MetaData:testHost DEST_KEY = _MetaData:transation_non_zero REGEX = (transaction\_1) FORMAT = transation_non_zero_routing

https://docs.splunk.com/Documentation/Splunk/8.1.0/Forwarding/Routeandfilterdatad

 

 Best Regards,

Sekar

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
0 Karma

to4kawa
Ultra Champion
_MetaData:Index     : The index where the event should be stored.

https://docs.splunk.com/Documentation/Splunk/8.1.0/Admin/Transformsconf

Regular expressions require more information, so try to do it yourself.

Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...