I had someone contact me recently with some confusion about the Read Text Log activity in Orchestrator. It seems that it wasn’t quite working the way they expected and they were left scratching their head. So I put together a quick demo runbook and tested it out. I thought I’d share my experience just to help any others out there that might be sharing the same confusion.

First, I created a simple log file with a few entries.

image

I configured my activity like this:

clip_image002[5]

The time set for getting log lines “more recent than” was the second entry in the log. I put in the custom timestamp format so it would know how to interpret the time, and then I ran the activity in the Runbook  Tester. Here’s what came out:

image

You can see from this that when you use “lines more recent than”, it will actually return “lines equal to or more recent than”. So plan for that in your definition of the activity.

I then changed the settings of the activity to get log entries between two dates:

image

And here you can see that once again, the matching lines were inclusive of the dates and times I specified:

image

 

One interesting thing I found that is sure to cause confusion if it happens to you: If the last line in your log file does not have a carriage return (if the cursor doesn’t go to the next line), the last line will not be returned by the activity. It apparently doesn’t see that as a complete line and therefore doesn’t match it and return it.

So hopefully this little lesson on the Read Text Log activity will help you better understand how to use it. Until next time…

 

By the way…You can find the documentation for the Read Text Log activity on Technet:  http://technet.microsoft.com/en-us/library/hh206063.aspx