Splunk Search

How to extract the specific part for data from the file path?

smanojkumar
Contributor

To extract the specific part for data from the file path,

C:/Users/USSACDev/AppData/Local/Temp/WindowsAETemp/35018_2225424_1655272292585
C:/Users/USSACDev/AppData/Local/Temp/WindowsAETemp/35018_2225421_1655272247058


The bolded part should be extracted, as i already extracted by a regex command,
| rex "\"aeci\".*\"temp_path\":\s+\"(?<activity_id>[^\"]+)"
By the above command, I got the file path, In that i need the specifies bolded part,

Can anyone help in this, Provide the single regex command that should include above specified regex command, like, it should be from, aeci (used in above regex)
.

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Does this work for you?

| rex "\"aeci\".*\"temp_path\":\s+\".*?\/(?<activity_id>[^\"\/]+)\""

View solution in original post

smanojkumar
Contributor

Hi @ITWhisperer ,

   Thanks for your response, It worked.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Does this work for you?

| rex "\"aeci\".*\"temp_path\":\s+\".*?\/(?<activity_id>[^\"\/]+)\""
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...