All Apps and Add-ons

Syslog data to separate index

bharathkumarnec
Contributor

Hello All,

We have two separate servers with host name ABC & xyz, these servers are sending data to Syslog index via port 5514.

We wanted to send xyz host data to separate index for example syslog1.

Kindly help me out on how to achieve this.

0 Karma
1 Solution

MuS
SplunkTrust
SplunkTrust

Hi bharathkumarnec,

Use props.conf and transforms.conf for this either on the HWF or IDX if you don't have a HWF

 #props.conf
 [syslog]
 TRANSFORMS-routing_for_syslog1_index = route_to_syslog1_index

 #transforms.conf
 [route_to_syslog1_index]
 DEST_KEY = _MetaData:Index
 SOURCE_KEY = MetaData:Host
 REGEX = xyz
 FORMAT = syslog1

This will route all events from host xyz into the syslog1 index.

Cheers, MuS

View solution in original post

0 Karma

MuS
SplunkTrust
SplunkTrust

Hi bharathkumarnec,

Use props.conf and transforms.conf for this either on the HWF or IDX if you don't have a HWF

 #props.conf
 [syslog]
 TRANSFORMS-routing_for_syslog1_index = route_to_syslog1_index

 #transforms.conf
 [route_to_syslog1_index]
 DEST_KEY = _MetaData:Index
 SOURCE_KEY = MetaData:Host
 REGEX = xyz
 FORMAT = syslog1

This will route all events from host xyz into the syslog1 index.

Cheers, MuS

0 Karma

bharathkumarnec
Contributor

Thanks for the reply.

We have hosts with xyz, xyz1, xyz2.
So in regex can we give xyz*, will it take??

0 Karma

bharathkumarnec
Contributor

This is my actual props & transforms settings:

[source::tcp:5514]
TRANSFORMS-idx = syslog_idx

[syslog_idx]
SOURCE_KEY = _raw
REGEX = .+
DEST_KEY = _MetaData:Index
FORMAT = syslog

Do I need to add the above stanza's separately or under these??

0 Karma

bharathkumarnec
Contributor

Below one worked well:

props.conf

[syslog]
TRANSFORMS-routing_for_syslog1_index = route_to_syslog1_index

  1. #transforms.conf [route_to_syslog1_index] DEST_KEY = _MetaData:Index SOURCE_KEY = MetaData:Host REGEX = xyz
  2. FORMAT = syslog1

Thanks for the help!

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!

Build the Future of Agentic AI: Join the Splunk Agentic Ops Hackathon

AI is changing how teams investigate incidents, detect threats, automate workflows, and build intelligent ...

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

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...