Getting Data In

Filter according folders of the source filed

avitallange
Explorer

Hi,

I would like to have the option to filter according the sub folders of the source.
For example:
If my source is: E:\Logs\ComponentNameX\InstanceY\logZ.txt

I would like extract the folder of ComponentName and the folder of InstanceName.

Could you please help to do this?

Thanks!

Tags (3)
0 Karma

mloven_splunk
Splunk Employee
Splunk Employee

avitallange,

I haven't done this before, but I'd guess that this would work.

In transforms.conf

[myextraction]
SOURCE_KEY = MetaData:Source 
REGEX = E:\\Logs\\([^\\]+)\\([^\\]+)\\.*\.txt
FORMAT = component::$1 instance::$2

And in props.conf

[your_sourcetype_name]
REPORT-myextraction = myextraction
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...