Getting Data In

Changing host for syslog

a212830
Champion

Hi,

I have syslog messages coming in from thousands of servers, and I'm using splunk to index those messages. The messages are duplicated across 3 regional servers. I need the ability to show the forwarder that processed the event. How do I do that, since I change the hostname to be the network device?

Tags (3)
0 Karma
1 Solution

sbrant_splunk
Splunk Employee
Splunk Employee

You can utilize props and transforms to grab the host metadata, before it is changed and assign it to a new field. Here is an example:

# -- props.conf
[sourcetype]
TRANSFORMS-fwd_host = forwarder_host

# -- transforms.conf
[forwarder_host]
SOURCE_KEY = MetaData:Host
REGEX = host::(.*)
DEST_KEY = _meta
FORMAT = forwarder::$1

View solution in original post

0 Karma

sbrant_splunk
Splunk Employee
Splunk Employee

You can utilize props and transforms to grab the host metadata, before it is changed and assign it to a new field. Here is an example:

# -- props.conf
[sourcetype]
TRANSFORMS-fwd_host = forwarder_host

# -- transforms.conf
[forwarder_host]
SOURCE_KEY = MetaData:Host
REGEX = host::(.*)
DEST_KEY = _meta
FORMAT = forwarder::$1
0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...