Splunk Enterprise

Is it possible to store events coming from the same source in different indexes, depending on their content?

michaje
Explorer

Hi,

Perhaps this question has been asked before...  Is it possible to store events coming from the same source in different indexes, depending on their content?

The use case is that some events are more sensitive than others and need to be sent to different indexes.

In our case, the index name would appear within the event, as a formatted field, like [index: SENSITIVE].

The input is a TCP port.

Any help would be appreciated, and I prefer to take no as an answer than to be led into some intricate solution.

Thank you,

Jean

Labels (1)
0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

it’s possible, but what is your real issue what you are solving this way?

How your stream is generated in source side and are there several or only one source?

r. Ismo

michaje
Explorer

Thank you for the quick answer!

The question here is whether the <new-value> can be a variable found within the event using a regexp that would extract the value.

0 Karma

dural_yyz
Motivator

I believe so but I've never tested and I don't have a dev environment to verify.  You can try inside your regex to create an unnamed capture group.  Inside the FORMAT tag replace <new-value> with "$1".

michaje
Explorer

Thank you for the suggestion.  I could not test it, as an alternative approach has been adopted in the meantime.

0 Karma

dural_yyz
Motivator

transforms.conf

 [index_reset]
 SOURCE_KEY = _raw
 DEST_KEY =  _MetaData:index
 REGEX = .
 FORMAT = index::<new-value>

This searches the _raw data feed for the regex match (change my example), then applies the FORMAT to the DEST_KEY.

Test in development environment first to fine tune this process, it can be tricky to get the regex and format just right.

Get Updates on the Splunk Community!

.conf25 Registration is OPEN!

Ready. Set. Splunk! Your favorite Splunk user event is back and better than ever. Get ready for more technical ...

Detecting Cross-Channel Fraud with Splunk

This article is the final installment in our three-part series exploring fraud detection techniques using ...

Splunk at Cisco Live 2025: Learning, Innovation, and a Little Bit of Mr. Brightside

Pack your bags (and maybe your dancing shoes)—Cisco Live is heading to San Diego, June 8–12, 2025, and Splunk ...