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!

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...

New Year. New Skills. New Course Releases from Splunk Education

A new year often inspires reflection—and reinvention. Whether your goals include strengthening your security ...