This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Unless they did something really cool in 2018.1 or .2 you can't do what you ask using the RunCommand event.
Only the Email Event or Send Email tool offers %OutputLog% or really any of those %% variables, per my prior post. I think you need to let go of how you want to do it, how you initially envisioned doing it, and consider alternatives described in my prior post.
The choice of which approach depends on how you intend to use the result...are you just wanting to review the one log for a single job manually or do you want to analyze many logs for many jobs? do you have automation or not? Is it easy for you to review via email or process many emails for logs? or is it just easier to go to a folder of logs?
Perhaps the easiest and most flexible solution for you to explore is the 3rd bullet talking about the "User Settings" where you can set up a default folder for logs.
You don't need automation or API licensing for this...You can manually review a log or write a parsing program, easy to do in Alteryx, to parse some or all the logs. I do this to track errors by workflow, timeline and user to help manage our body of work and our users and alert when some new issue crops up as they do with new versions of Alteryx or new security policies and software and other system issues...or identify users who need a little more training....
At least, now I am clear that I cannot do it from runcommand.
I have multiple jobs and would have all the logs parsed and ingested in database. I am trying to avoid third method because then I have to provide the default temporary Directory (I am not sure which directory on server/gallery should I use).
In your second method, can you please elaborate on this :
"you can define a logfile in the batch and capture the outputlog data by redirect to the logfile"
If you have the Alteryx Server product or a Desktop Designer with APi/Scheduler feature added you have the ability to run Workflows from the command line. We needed more complexity in our scheduling criteria and wrote my own scheduler that dynamically builds a batch file for any flow it is to run. part of that is capturing the run info to a log..The second bullet shows an example batch file the defines a log file, runs the flow and redirects the run messaging to the logfile.
Bullet three which you say you do not like is quite similar except the log files are cryptically named by Alteryx in this option and in option 2 you have control over the actual logfile name and pattern it on the flow name.
Simple fact is that once the log is written you will handle them the same, either manually review them or programatically parse them for results.
you have total control over the folder location in option 3 as in option 2. Just option 3 is user specific and will capture manually run jobs and automated jobs. Option 2 captures only the job run from the batch file.
So there are pros and cons, really just flavors of pros, for either option. I have lobbied Alteryx to change the system generated cryptic log name for one based on a flow name so it is more useful for humans to manually review, more easily spotting which log file is for what flow and instance...but if you take a few minutes to review both you will see the parse and eval portion of the task is essentially the same and the front end task of writing the log is the only real difference and each has its place, actually at this point I see option 3 as potentially the better option but to explain is more than I will do in blogging here.
the variable %OutputLog% can only be used in an email sent via a "Send Email" event or the "Send Email" Tool. I explained this and other ways to capture the log info in my linked post above this reply. I do not believe the set of variables including %OutputLog% can be referenced and passed in any other tool. my linked post explains how you can set up automatic logging to a folder of your choice and then parse the logs to your hearts content.
If you dig into the API I expect you could figure out a way to access the %OutputLog% in a different way...but that requires an API license and probably more involved effort than you are ready for, especially when these other ways are so easy.
Making use of the logging directory option in User Settings lets you get what you want... It's just not the way you wanted to go about it. I am not aware of any other ways to accomplish you goal beyond those in my post.
Sorry I don't have designer handy right now but if you want to capture the output log for parsing and analysis I suggest you go to system settings and turn logging on to a folder of your choosing. It is System Settings then Engine then General then Logging Directory.
Each time you run a flow the log you see will also be written to that folder. Unfortunately the log name is cryptic but you can tell by the time created or by opening the log and see the flow. I created a flow to read the logs and it renames them based on flow name and timestamp and also parses errors and generates a report of errors.
Or you can use the send Email tool...pretty sure the example shows that and a few other variables available. unfortunately those variables are not directly addressable so Send Email and turning on logging are your best options without API/Scheduler or Server features.
Thank you for the solution. I was wondering if it works if I have placed the APP in google drive which is shared with other people to use. If I alone change settings in the APP will it work for other shared users?
If I make a change in settings will that be applicable only to that specific APP? I wanted to capture log for each APP in particular directory. The solution which you offered seems like every APP logs will be stored in single directory. Please correct me if i have understood something wrong.
you must have a SERVER/Gallery...in which case you publish to the gallery and not host on a google drive or other location....
if no SERVER/Gallery then those whom you would share it with must also have a desktop license to run an Alteryx flow/app...but you can put it anywhere the others can also access.
if you use logging option that is set in system settings and is specific to your/that instance and applies to all Apps/flows run by that instance of Alteryx. Others would need to turn logging on as well. Also in the server settings it would need turned on.
Depending on your needs you might set up a shared network folder specifically to capture the logs and have all who would use it point to that folder.
Then it becomes more work administratively...every flow will write a log...not just that one...and the logs are named cryptically so you won't be able to know by file name what flow created the log. But parsing the logs you can get the flow/app name and all other info you need from the log content.
And you have an ever growing list of logs in that folder you need to manage.
Peeling the onion on this issue one needs to consider if this needs an enterprise approach or a smaller localized approach
An email to capture output log may solve one-offs or localized needs for a specific App.
If not an App you could potentially run a flow from run command or preset batch file and use command line redirect to a file to capture the output log that way....which can be both a good solution for an enterprise or localized need but you can run Apps the way.
If an Enterprise solution is needed then I like using logging so I have a directly accessible log of all flows run, App or Flow, and can programmatically parse them for errors and stats for reporting and alerts and automation purposes. I can also dynamically delete old logs from the same flow when I no longer want or need to keep them thus keeping the log folder from growing excessively.
Also you can write a macro that will read most any file, even if schema changes, dynamically or since the log files have the same schema a dynamic input fed a list of files from a directory tool can be the starting point of your parsing flow to parse the log content.
Thank you so much for giving me an detailed explanation
As you already mentioned I have to place the APP in shared location and other users have alteryx desktop version to run the APP.
I would like to know more about the comment which you made "If not an App you could potentially run a flow from run command or preset batch file and use command line redirect to a file to capture the output log that way...". Can you please help me with an example of how it can be done?