Learn how to use the event log trigger to make Automate act in response to application or system generated errors, warnings, successes, or failures sent to the event log. Brigette Matz, Automate Trainer/Consultant, will show you how to set up an event log trigger. In this video you’ll learn how to:
- Add an event log trigger to a task
- Select the type of event log to monitor
- Set how Automate should respond when triggered
Watch this chapter now to learn more about the event log trigger.
Brigette Matz: The Windows Event Log Trigger is commonly used to make Automate act and respond to system or application generated errors, warnings, successes, or failures that are sent to the Windows Event Log. In this example, we'll configure a trigger that monitors for an Automate 11 error log entry to the Windows Event Log. [00:00:30] The trigger will launch a simple task which generates a dialogue message box displaying details of the logged error.
The second task that's listed here is the one that I wanna trigger based on that event log entry. So first I'm going to go ahead and right-click on this task, and then I'm gonna select Edit Triggers. From here, we'll select Add, and then select the event log trigger and click Ok.
[00:01:00] The first thing we want to do is select the type of event log that we're going to monitor. You can use this drop-down to select the desired log, or you can enter the log type manually. In this case, we'll go ahead with the application log type.
Now we'll select the source of the event in which to monitor. The drop-down here shows all available sources on the system, and in this case we're gonna go ahead and monitor for our Automate 11 source.
This field indicates the type of event [00:01:30] that we're monitoring for, whether it's an information event, a warning, an error, a successful audit which records the security access attempt that is successful, a failure audit which records a security access attempt that fails, or we can opt to monitor for any event type. In this example, we're looking for an error event.
For the category, the default here is all categories, and it's actually the only option that we have to select, so we'll go ahead and leave that as the default. [00:02:00] And down here, we can input a description for the event if desired. As you can see, to monitor for partial descriptions we wanna use the wildcard characters of asterisk of question mark. And in this case, I will use that asterisk wildcard to account for events with all descriptions.
Under the behavior section, you can opt to disable the trigger so it will stay inactive until it is manually enabled at a later time. This option is enabled by default. And below that, you can also indicate [00:02:30] how many times the trigger condition must be met before the task is started. If I select this and we use the default of two, then Automate will wait until two error events have been logged before initiating the task.
Since we wanna trigger this task after one instance, I'll deselect that and click Ok to get back to our trigger list, and then I'll hit the back button again here to get back to our task list.
So I've got two tasks here. The first one [00:03:00] here is to open our Notepad application and write some text into that application. If an error occurs, we're going to write details of that error to our Windows event log as the description indicates here.
I've actually already configured this task to encounter an error, and so when that occurs it will write the details to the Windows event log as I mentioned. And that should initiate this trigger task, the second task listed here, to monitor for that Windows event log error. And then once it finds that, it's going to display [00:03:30] a dialogue message with details about that error.
So I'm gonna click the Run button here to run that first task, and we'll see that it is running through. It's going to write that error to the event log because we know that it's going to error out, and here we do see in the bottom right corner that our second task actually has already triggered based on that error, and our dialogue box here gives us some information about that error. It came from Automate 11, the date, and then the description of that error as well.
[00:04:00] Now that we've seen our trigger work in action, let's go ahead and take a look at the task itself. I'll right-click and click Edit Steps here, and we can look a little bit further at the configuration of this task, and what we're actually executing once that trigger event occurs.
So this task consists of a single step. Let's right-click and edit the step to open its properties. [00:04:30] In here, in the properties, we'll see that the step is configured to open a dialogue message box and display information from the triggered event. So, when the trigger is activated, it automatically passes this AM trigger object to the task. The AM trigger is a standard Automate data set, and can be used much like the data sets created by the sequel query and email actions.
So let's slightly reconfigure this. We'll access our expression builder here by clicking the % sign in the top-right corner. And [00:05:00] down here under our objects we'll hit the drop-down arrow, and then we'll look at our trigger objects. We'll scroll down and we'll find our event log trigger. Under the event log here, we can see the AM trigger objects which can be used to reference the specific values related to the trigger event captured by the Windows event log.
Okay, so I'm gonna move this window over just a bit so we can see what's currently configured. We don't have the event ID in there yet, so let's go ahead and add that. [00:05:30] And then I'll reformat this a little bit so that, when we trigger this task again and we see it run, we'll see a different dialogue message pop up, just slightly different. We'll add the headers here in front of these objects.
And then the next time that this task is triggered off, we will see these objects identified, and then they will also reference the specific values associated with those objects. So I'll space it out a little bit here to make it cleaner looking. [00:06:00] We'll click Ok. Go ahead and save and close our task.
Okay, so let's go ahead and run this first task again, which will result in an error. It's going to write the error details again to the Windows event log, and that will kick off our second task, it will trigger our second task here from that Windows event log input, and it will display that new message that we just configured. So I'll go ahead and click that first one, and let's go and click Run and see that happen here.
[00:06:30] All right, once this first task hits that error and logs that to our event log, we'll see another window pop up in the righthand corner there, saying that trigger has occurred. And we'll see our popup dialogue box here with the new message that we've configured.