Getting Data In

Index data from a file and send to differents indexes

tdepablo88
Explorer

Hi everyone,

I am trying to index data from a single log file to different indexes but i can't do it, i have this data wich need to route to diferent indexes:

svr80001.xxxxxx.com [UDP: [172.22.175.102]:27869->[172.22.172.244]:162]:
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (121711881) 14 days, 2:05:18.81

<UNKNOWN> [UDP: [115.100.9.100]:56090->[172.22.172.244]:162]:

I need to filter using the ipaddress, and i follow the next link https://community.splunk.com/t5/Getting-Data-In/How-to-filter-data-from-a-single-file-and-write-to-t... but isn't work to me.

Regards, Diego

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The sourcetype can be changed by specifying the proper destination key.  You already have a destination key specified, however, so I'm not sure you can make both changes.

If your problem is resolved, then please click the "Accept as Solution" button to help future readers.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Please share the props.conf and transforms.conf settings you're using to route the events to different indexes.

---
If this reply helps you, Karma would be appreciated.
0 Karma

tdepablo88
Explorer

props.conf

[cisco-prime_snmtp-traps]
TRANSFORMS-reenvioindexes= wlc_pams, aruba

transforms.conf

[wlc_pams]
REGEX= /\[UDP: \[115\.100\.9\.100\]/g
DEST_KEY = _MetaData:Index
FORMAT = wlc_pams

[aruba]
REGEX= /\[UDP: \[172\.22\.175\.102\]/g
DEST_KEY = _MetaData:Index
FORMAT = Aruba

thank you

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The problem (or perhaps one of the problems) is the REGEX strings do not match the data.  The events do not have the UDP address surrounded by slashes.  Try these, instead.

[wlc_pams]
REGEX= \[UDP: \[115\.100\.9\.100\]
DEST_KEY = _MetaData:Index
FORMAT = wlc_pams

[aruba]
REGEX= \[UDP: \[172\.22\.175\.102\]
DEST_KEY = _MetaData:Index
FORMAT = Aruba

 

---
If this reply helps you, Karma would be appreciated.

tdepablo88
Explorer

Rich,

thanks for the help it works perfectly, now can i define a another sourcetype for the redirection, example:

[wlc_pams]
REGEX= \[UDP: \[115\.100\.9\.100\]
DEST_KEY = _MetaData:Index
FORMAT = wlc_pams
SOURCETYPE = another?

regards.

Diego

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The sourcetype can be changed by specifying the proper destination key.  You already have a destination key specified, however, so I'm not sure you can make both changes.

If your problem is resolved, then please click the "Accept as Solution" button to help future readers.

---
If this reply helps you, Karma would be appreciated.
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!

Event Series: The Agentic SOC: Trust Before Autonomy

AI is fundamentally changing security operations, but true progress requires more than just automation—it ...

Free Professional Services for .conf26 Attendees

This year at .conf26, we are doing something a little different. We are bringing the best minds from ...

Defend at Machine Speed: Your Guide to Security Sessions at .conf26

Splunk .conf26   With threats moving at machine speed and attack surfaces expanding across hybrid ...