Hello - I am trying to create a workflow that reads the directory where the alteryx logs are posted, selects log files created on a specific date (could be many depending on how many ran on the server) and then searches through the log files for the string "error" so we can know if any workflows failed. I sort of got started using the directory tool and was able to generate a list of the files I want, but I could not figure out a way to search though them all for the "error" string. So I then backed up and just pulled in one log file and for some reason alteryx had trouble reading it. It is a .log file and may be in XML format or something but I can't tell for sure. I tried reading it as a fixed length ascii but that led me nowhere either. Any help out there on how to do this? The ideal solutuon would be to also identify the yxmd workflow that failed (which is in the first line of the log). Would be greatly appreciated! Art.
Solved! Go to Solution.
Hello @artzee1556 ,
Try reading the inputs as csv, when it asks you for a delimeter put then \0
This will give you on every row each line of the log file.
The rest is easy, you can just filter then with a filter tool and the contain, to look for errors.
If you are going to read more than one file at a time would recommend you also to output the filename to the data
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Regards
Thanks so much afv2688! Th solution to read an individual file as a CSV was perfect. The challenge now is reading in multiple log files output by the Directory tool. Is there a way to search through the list of files output by the Directory tool? I saw some solutions out there but none that either (1) was a good fit for the problem or (2) I couldn't get to run. Thanks again.
Hi @artzee1556
The output of the Directory tool includes the last write time for all the files. Filter this for the date you're looking and pass the resulting files to a Dynamic input configured to read them as CSV, \0 for the delimiter and include the file name. The output of this will be the text of all the files that passed your date filter.
Dan
Hello @artzee1556,
This is a demnostration of what @danilang was talking about.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Regards
Thanks Dan and AFV. I figured out the template thingy. A big phat Duh! on that. It works! Thanks for your help.