Getting Data In

How to Route Events to New Index Based on Original Index Name?

beaunewcomb
Communicator

We are, unfortunately, having to change index names to match a naming convention.  I have a list of indexes that need to be "renamed" ... for routing to the new indexes, rather than track down all the configs which are managed with DS, chef, and other tools, I would like use props\transforms on the HWF's and IDX's to look at every event, and if it was destined for index foo, send it to index foo.  

Here is what I have on a single Splunk instance, in system/local (for simplicity and testing the config):

props:

 

 

 

[default]
TRANSFORMS-foo_idx_rename= foo_idx_rename

 

 

 

transforms:

 

 

 

[foo_idx_rename]
SOURCE_KEY = MetaData:Index
REGEX = (foo)
DEST_KEY = _MetaData:Index
FORMAT = bar

 

 

 

I've tried:

REGEX = foo

REGEX = "foo"

REGEX = "*foo*"

REGEX = index::foo

Nothing I've tried seems to work.

Questions I have:

What is the actual value that the regex needs to evaluate for the index metadata field? (ie-  index::foo or just foo)
Are double quotes required in the regex?  Must there be ()'s?

I've seen a couple examples that say they work, but when I copy them verbatim, they do not.

Labels (2)
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Unlocking Unified Insights: New Gigamon Federated Search App for Splunk

In today’s data-heavy environment, organizations are caught in a data distribution dilemma. As data volumes ...

GA: New Data Management App in Splunk Platform

Streamlining Data Management: Introducing a unified experience in Splunk Managing data at scale shouldn’t feel ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...