Splunk Search

Can anyone help me split this field into 2?

hok2010
New Member

Hi!

temp=C:\Program Files\SplunkUniversalForwarder\bin\splunk-powershell.exe

to...

path=C:\Program Files\SplunkUniversalForwarder\bin
process=splunk-powershell.exe

this is what I reach...

I'm stuck at the regex.

Any other method is also appreciated

| rex field=temp "(?[^\\\/]*)$"    |regex path=!temp    |table FILENAME,PATH
0 Karma
1 Solution

inventsekar
SplunkTrust
SplunkTrust

(pls check this.. very manual rex,..

| makeresults 
| eval temp="C:\Program Files\SplunkUniversalForwarder\bin\splunk-powershell.exe" 
| rex field=temp "(?P<path>\w+\W+\w+\W\w+\W\w+\W\w+\W)(?P<fileName>\w+\W\w+\W\w+)"
| table path fileName

alt text

PS - if it resolves your task, pls accept this as answer

View solution in original post

inventsekar
SplunkTrust
SplunkTrust

(pls check this.. very manual rex,..

| makeresults 
| eval temp="C:\Program Files\SplunkUniversalForwarder\bin\splunk-powershell.exe" 
| rex field=temp "(?P<path>\w+\W+\w+\W\w+\W\w+\W\w+\W)(?P<fileName>\w+\W\w+\W\w+)"
| table path fileName

alt text

PS - if it resolves your task, pls accept this as answer

diogofgm
SplunkTrust
SplunkTrust

Try this:

(?<path>.*)\\(?<file>[^\\]*)$
------------
Hope I was able to help you. If so, some karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...