Splunk Search

How to Change Cisco SG350 Switch's sourcetype from syslog to cisco:ios?

splunkot
New Member

I have Cisco Networks App for Splunk Enterprise version 2.5.6 and Cisco Networks Add-on for Splunk Enterprise version 2.5.4 working great for the supported devices. I believe the SG350 switch is not supported, so the sourcetype="syslog". How do I change the source type for all my SG350 from syslog to cisco:ios, so that it can populate the Cisco Network Overview GUI?

Tags (1)
0 Karma
1 Solution

MuS
SplunkTrust
SplunkTrust

Hi splunkot,

you can do this on the parsing Splunk instance, that is either a heavy weight forwarder or an indexer. You need to configure a stanza in props.conf for syslog:

props.conf

[syslog] 
TRANSFORMS-001_syslog_sourcetype_rewrite = syslog_sourcetype_rewrite

and finally in transforms.conf set the regex to match the hosts or IP's of the SG350 devices:

transforms.conf

[syslog_sourcetype_rewrite] 
REGEX = whatevermatcheshostnamesofyourSG350devices
SOURCE_KEY = MetaData:Host 
DEST_KEY = MetaData:Sourcetype 
FORMAT = sourcetype::cisco:ios

This will only re-write the sourcetype for the SG350 devices.
You will need to restart the Splunk instance where you configured these config files, and it will only apply to new events.

Hope this helps ...

cheers, MuS

View solution in original post

0 Karma

MuS
SplunkTrust
SplunkTrust

Hi splunkot,

you can do this on the parsing Splunk instance, that is either a heavy weight forwarder or an indexer. You need to configure a stanza in props.conf for syslog:

props.conf

[syslog] 
TRANSFORMS-001_syslog_sourcetype_rewrite = syslog_sourcetype_rewrite

and finally in transforms.conf set the regex to match the hosts or IP's of the SG350 devices:

transforms.conf

[syslog_sourcetype_rewrite] 
REGEX = whatevermatcheshostnamesofyourSG350devices
SOURCE_KEY = MetaData:Host 
DEST_KEY = MetaData:Sourcetype 
FORMAT = sourcetype::cisco:ios

This will only re-write the sourcetype for the SG350 devices.
You will need to restart the Splunk instance where you configured these config files, and it will only apply to new events.

Hope this helps ...

cheers, MuS

0 Karma

splunkot
New Member

Thank you MuS, that did the trick.

0 Karma
Get Updates on the Splunk Community!

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...