Getting Data In

How to split events in a syslog file to separate index

wczimmerman
Engager

I have a simple syslog server that collects data from many hosts and splunk is indexing the syslog logfile. I would like to separate data from a handful of hosts into a separate index at index time. What would be the best way to go about this?

Tags (2)

Ron_Naken
Splunk Employee
Splunk Employee

It would be ideal to send the syslog data straight to Splunk, and setup a separate port for the for the handful of hosts -- since you can specify an Index when defining the data input.

Otherwise, you could use a RegEx to identify the data you want to move, like this:

PROPS.CONF:
[source::...mysyslogfile...]
TRANSFORMS-movestuff = xf_index

TRANSFORMS.CONF:
[xf_index]
REGEX = matchthis
DEST_KEY = _MetaData:Index
FORMAT = thisindex

Use FORMAT to specify the index name. Don't forget to create your index, first.

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...