Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have log files data which is in .text format.I have 4 different folders and it will have the logs.
Root/
folder 1/
log.1
log.2
folder 2/
log.1
log.2
Now i want to go to each folder and read the each log file need to get specific formatted line.
Example:Line start with the timestamp and in middle i have key manager:85 which is common for all logs then will get request id:
I need the last request id from the line from all logs.
2021-08-17 00:00:01 ############# Manager:85 process request id :12345
2021-08-17 01:00:01 ############# Manager:85 process request id :7474794
2021-08-16 12:00:01 ############# Manager:85 process request id :789494
What is the issue you need help with is it to loop through the folders and files or is it extraction the rows from the files.
You can create a loop for your folders and files using the For each vfolder in dirlist(...) next and For each vfile in filelist(...) next statements.
Fetching the id from each row in the files you can use the following load statement.
Let vSearchString = 'Manager:85 process request id :';
LOAD
mid(LOGTXT,index(LOGTXT, '$(vSearchString)')+len('$(vSearchString)')) as [Process request id]
FROM
LogFile
;