Getting Data In

Route syslog UDP data to specific index and sourcetype

phoenixdigital
Builder

Simple task and I am sure I am close here.

A UDP port is open on a heavy forwarder and data is coming in to source udp:514

Now at present there is only one type of data arriving here but as time progresses we will be sending different sourcetypes to this port.

I am trying to detect the data as it arrives and assign a sourcetype and index. The sourcetype reassingment is working but the index reassignment is not.

Configs on the heavy forwarder below.

inputs.conf

[udp://514]
connection_host = ip
sourcetype = hf:syslog
index = test_data

props.conf

[source::udp:514]
TRANSFORMS-1force_sourcetype = force_sourcetype_asa,force_sourcetype_for_pix,force_sourcetype_for_fwsm
TRANSFORMS-2index_routing = syslog_index_routing

I tried reordering the TRANSFORMS swapping 1 and 2 around but no joy.

transforms.conf

[force_sourcetype_for_asa]
DEST_KEY = MetaData:Sourcetype
REGEX = %ASA-\d-\d{6}
FORMAT = sourcetype::fw:asa:log

[force_sourcetype_for_fwsm]
DEST_KEY = MetaData:Sourcetype
REGEX = %FWSM-\d-\d{6}
FORMAT = sourcetype::fw:fwsm:log

[force_sourcetype_for_pix]
DEST_KEY = MetaData:Sourcetype
REGEX = %PIX-\d-\d{6}
FORMAT = sourcetype::fw:pix:log

[syslog_index_routing]
SOURCE_KEY = MetaData:Sourcetype
DEST_KEY = MetaData:Index
REGEX = fw:asa:log
FORMAT = sec_firewall

Tired this but it didn't work either
FORMAT = index::sec_firewall

Any hints?

I know I am close.

0 Karma
1 Solution

crash1011
Explorer

You were very close!

The Index setting (as opposed to say Sourcetype or Host) requires the MetaData command to be preceded by an underscore e.g.

DEST_KEY = _MetaData:Index,

View solution in original post

crash1011
Explorer

You were very close!

The Index setting (as opposed to say Sourcetype or Host) requires the MetaData command to be preceded by an underscore e.g.

DEST_KEY = _MetaData:Index,

phoenixdigital
Builder

Thanks for that.

Weird/annoying that the configs are so inconsistent.

0 Karma

phoenixdigital
Builder

Secondary question is this bad practice to send many different sourcetypes to the same UDP syslog port?

Is it better to say listen on port

514
515
516
.....

Then have a unique sourcetype going to each port.

This obviously wont work if the device sending the logs cannot use custom ports.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...