Getting Data In

Changing Sourcetype at Index Time on Heavy Forwarder?

marrette
Path Finder

Hi,

I would like to change the sourcetype of data being received from a UDP Syslog stream via a heavy forwarder.

On the heavy forwarder I have deployed an app configured with the following:

inputs.conf:

[udp://10.1.2.3:514]
connection_host = dns
index = MyIndex
sourcetype = syslog

Data sent to the Splunk Heavy Forwarder host (Splunk version 6.4.1 running on Windows) is received by Splunk and the sourcetype, as expected is set to syslog. I would like to change the sourcetype to something more descriptive and have found if I just edit the sourcetype in the inputs.conf file data is not received (I assume setting the sourcetype to syslog effects the way Splunk behaves as it receives the data?)

So anyway I created a props.conf file with the following in:
props.conf:

[syslog]
TRANSFORMS-changesourcetype = set_sourcetype_to_MyAppUDP

and then created a transforms.conf like this:

[set_sourcetype_to_MyAppUDP]
FORMAT = sourcetype::MyApp-UDP
DEST_KEY = MetaData:Sourcetype
WRITE_META = true

I've deployed it to the heavy forwarder and am receiving data but the sourcetype is not being changed and I'm unsure why?

Thanks
Eddie

0 Karma
1 Solution

sduff_splunk
Splunk Employee
Splunk Employee

You may need to include a REGEX in the transforms

 [set_sourcetype_to_MyAppUDP]
 REGEX = .
 FORMAT = sourcetype::MyApp-UDP
 DEST_KEY = MetaData:Sourcetype
 WRITE_META = true

View solution in original post

tahaeeh
New Member

hello everyone, I want to change sourcetype and index in incoming events. In 514UDP I have many different type of logs (cisco, Fortigate, Fortiweb, ....)

How could I change Sourcetype and Index on Heavy Forwarder :(this is my try but it does not work) :

Props:

[source::udp:514]
TRANSFORMS-1sourcetype = fortigateevent
TRANSFORMS-2index_routeing = fortigateeventindex

Transforms:

[fortigateevent]
REGEX = devname= .*
DEST_KEY = MetaData:Sourcetype
FORMAT = sourcetype::fgt_log

[fortigateeventindex]
REGEX = .*
DEST_KEY = _MetaData:Index
FORMAT = fortinet

0 Karma

sduff_splunk
Splunk Employee
Splunk Employee

You may need to include a REGEX in the transforms

 [set_sourcetype_to_MyAppUDP]
 REGEX = .
 FORMAT = sourcetype::MyApp-UDP
 DEST_KEY = MetaData:Sourcetype
 WRITE_META = true
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

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 ...