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!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...