Getting Data In

How can I redirect mcollect to a different set of indexers?

daniel333
Builder

All,

I have a |mcollect job that runs every night. I'd like the the results to goto a different indexer rather than the default on my search heads.

How do I specify the metric sourcetype in a props+transform to redirect it?

0 Karma

MuS
SplunkTrust
SplunkTrust

Hi daniel333,

you need to add a sourcetype to the mcollect that does exists anywhere else, and use this in your props.conf & transforms.conf to redirect the collected events.

The following is UNTESTED and might as well not work - but should give you an idea how it can be approached.

First configure props.conf on the parsing layer that receives the events from your search head (eq HWF or IDX):

props.conf

[MyMcollectSourceType]
TRANSFORMS-001-SendMyMcollectSourceTypeToAnotherIndexer = SendMyMcollectSourceTypeToAnotherIndexer

next you need a transforms.conf to tell Splunk what to do with the events:

transforms.conf

[SendMyMcollectSourceTypeToAnotherIndexer]
REGEX = .
DEST_KEY = _TCP_ROUTING
FORMAT = MyMcollectSourceTypeToAnotherIndexer

last but not least you need to configure an outputs.conf to tell Splunk where to send the events:

outputs.conf

[tcpout: MyMcollectSourceTypeToAnotherIndexer]
server = TheOtherServerDNSName:9997

Restart this Splunk instance, and run on your search head the mcollect search:

 ... | mcollect index=<string> sourcetype=MyMcollectSourceType

This should in theory work, but as mentioned previously this is untested so might as well not work ¯\_(ツ)_/¯

Anyway, hope this helps to get you started ...

cheers, MuS

0 Karma

MuS
SplunkTrust
SplunkTrust

and add to the outputs.conf the following stanza/option:

[tcpout]
indexAndForward = true
0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...