Getting Data In

I have a Log file where different .TXT files are present. How can I extract a field with the help of regular expression for all .TXT files are present ?

saibal6
Path Finder

;1;1;;;File not found : D:\WINDOP\COMS\WINDOP\IN\UPDATE.TXT
;3;1;;;File not found : D:\WINDOP\COMS\WINDOP\IN\STORE.TXT
;1;0;0;;D:\WINDOP\COMS\WINSDOP\IN\PROD.TXT
;1;0;2;;D:\WINDOP\COMS\WINSDOP\IN\MTPRO.TXT
;0;3;0;;D:\WINDOP\COMS\GARIA\IN\1449\CARDDOLD.TXT

Tags (1)
0 Karma

niketn
Legend

Try the following rex command for field extraction. You can use regex101.com for testing regular expression with your sample data:

 <yourBaseSearch>
| rex "(?<fqdnFile>\w\:[^\.]+\.TXT)$"

Following is the run anywhere example base d on sample data provided (commands from makeresults till rename are used to generate sample data):

| makeresults 
| eval data=";1;1;;;File not found : D:\WINDOP\COMS\WINDOP\IN\UPDATE.TXT|;3;1;;;File not found : D:\WINDOP\COMS\WINDOP\IN\STORE.TXT|;1;0;0;;D:\WINDOP\COMS\WINSDOP\IN\PROD.TXT|;1;0;2;;D:\WINDOP\COMS\WINSDOP\IN\MTPRO.TXT|;0;3;0;;D:\WINDOP\COMS\GARIA\IN\1449\CARDDOLD.TXT" 
| makemv data delim="|" 
| mvexpand data
| rename data as _raw
| rex "(?<fqdnFile>\w\:[^\.]+\.TXT)$"
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...