Getting Data In

partially rewrite event index name based on sourcetype value

sylbaea
Communicator

Hello,

I already know how to statically rewrite the index value based on a sourcetype.
Typically using something similar to:
https://answers.splunk.com/answers/246672/how-can-i-override-an-index-name-based-on-sourcety.html?ut...

But I have today a slightly more complex need.

events are generated on a HF as following:
- index = prefix-environment-default
- sourcetype = (5 different values)

per sourcetype, I need to rewrite the index as following:
- if sourcetype = sourcetype1 then "default" suffix in index name should be replaced by something else specific to this index
- but (this is the part I have not find how to manage yet)... the first part of the original index name should be changed... especially, the middle part (environment) will vary and should remain intact.

is it possible to apply kind of regex/sed to capture the "default" suffix and replace it by the suffix that match a given sourcetype ?
Then I would duplicate the transform to have one per sourcetype

Thanks.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...