I want to override the index name of my events (assigned at the forwarder) with a new index name based on sourcetype.
This can be done at the heavy forwarder or indexer:
On your indexer or heavy forwarder:
# etc/system/local/transforms.conf
[overrideindex]
DEST_KEY =_MetaData:Index
REGEX = .
FORMAT = my_new_index
#etc/system/local/props.conf
[mysourcetype]
TRANSFORMS-index = overrideindex
This can be done at the heavy forwarder or indexer:
On your indexer or heavy forwarder:
# etc/system/local/transforms.conf
[overrideindex]
DEST_KEY =_MetaData:Index
REGEX = .
FORMAT = my_new_index
#etc/system/local/props.conf
[mysourcetype]
TRANSFORMS-index = overrideindex
you must have the index already configured on the indexers in indexes.conf before sending events to the new index.
Can I do this based on specific host name, if yes, how?
Greetings from the future ...
Yes, you can specify a host name to be used in props.conf
see the docs for more details https://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf#GLOBAL_SETTINGS
cheers, MuS