Getting Data In

splunk rename source

SS1
Path Finder

I have my source name as below, the 'user' field keeps on updating

E:\test\Apps\path\EventLogs\MemoCPU\user-MemoCPU.log

I don't want to display the entire path but just want user-MemoCPU as source, can we achieve it?

0 Karma

manjunathmeti
Champion

You can extract using rex command:

| makeresults 
| eval source="E:\test\Apps\path\EventLogs\MemoCPU\user-MemoCPU.log" 
| rex field=source "(?<source>[^\\\\]+)\.log$"

 

If this reply helps you, an upvote/like would be appreciated.

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security: Your Command Center for PCI DSS Compliance

Every security professional knows the drill. The PCI DSS audit is approaching, and suddenly everyone's asking ...

Developer Spotlight with Guilhem Marchand

From Splunk Engineer to Founder: The Journey Behind TrackMe    After spending over 12 years working full time ...

Cisco Catalyst Center Meets Splunk ITSI: From 'Payments Are Down' to Root Cause in ...

The Problem: When Networks and Services Don't Talk Payment systems fail at a retail location. Customers are ...