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