Getting Data In

CLONE_SOURCETYPE not honoring REGEX?

manojnair
Engager

While attempting to clone (and mask) events that belong to select source patterns,. the CLONE_SOURCETYPE doesn't honor the REGEX. The goal is to restrict cloning to those events that have dev or tst in their source.  So prod or perf or uat etc wouldn't get cloned. 

it seems that the no matter what the REGEX in the clone stanza in transforms, the events gets cloned. 

The temporary solution was to run a nullQueue for those non-dev and non-tst sources.

What am I doing wrong here?  Any thoughts/suggestions? Note -The test file doesn't have any source defined. The only place I supply a source is using the rename-source argument as below

 

# Code fragment 

How I run this using oneshot -

splunk add oneshot test-foo.txt -rename-source "sfdc_object://User_splunk_dev_cnf" -index mask  -sourcetype sfdc:orig -host dev_01 [WORKS- clones should be created. Works as expected]

splunk add oneshot test-foo.txt -rename-source "sfdc_object://User_splunk_prod_cnf" -index mask  -sourcetype sfdc:orig -host dev_02  [DOESN'T WORK - clones shouldn't be created, but they are]

props..conf

[sfdc:orig]
TRANSFORMS-sfdc-orig = sfdc_cloner

[sfdc:clone]
EVAL-mn = "foo"

transforms.conf

# sources are one of the following -  sfdc_object://User_splunk_dev_cnf sfdc_object://User_splunk_tst_cnf      sfdc_object://User_splunk_prod_cnf ...

[sfdc_cloner]
#Only clone those where sources don't have _prod_ 
REGEX = ^(?=.*(dev|tst)).*
# Tried this as well - no bueno
#REGEX = (sfdc_object:.*(dev|tst)_cnf.*)

SOURCE_KEY = MetaData:Source
FORMAT = $0
DEST_KEY = _raw
CLONE_SOURCETYPE = sfdc:clone

Labels (1)
Tags (1)
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!

Agentic SOC Triage: Investigating Splunk ES Notables with MCP Server and a Local LLM

The Problem: Too Many Alerts, Too Little Context Security operations teams running Splunk Enterprise Security ...

All Work and No Play? Not at .conf26! Unwind at These Evening Events

Between hands-on technical sessions, keynote reveals, and diving into live architectures, .conf26 is packed ...

Join the Hackathon at .conf26 and build a No-Code AI agent

Join us for the AI Agent Buildathon, an in-person, three-hour hands-on Hackathon where you’ll use Splunk Agent ...