Getting Data In

Can I configure transforms.conf to route data to different sourcetypes and indexes based on host?

a212830
Champion

Hi,

I have a bunch of different hosts going to a network port for syslog and need to route to different indexes/sourcetypes based upon the hostname. Can I have one transforms that does both (for each different host regex)...

0 Karma

somesoni2
SplunkTrust
SplunkTrust

You can override only one metadata at a time using the Transforms, so you you'd need two transforms for each host regex to override both sourcetype and index. It should work like this

props.conf
[yourhostspecification]
TRANSFORMS-sourcetype=overridesourcetype
TRANSFORMS-index=overrideindex

transforms.conf
[overrideindex]
SOURCE_KEY = MetaData:Host
REGEX = rexForYourHost
DEST_KEY=_MetaData:Index
FORMAT = newindexname

[overridesourcetype]
SOURCE_KEY = MetaData:Host
REGEX = rexForYourHost
DEST_KEY=MetaData:Sourcetype
FORMAT = sourcetype::newsourcetype
0 Karma

shan_santosh
Explorer

What could be the value for REGEX if I want to set index for events coming from Server001?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...