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

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

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!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...