Skip to content

Alert Template Fields for Distribute Tasks

List of template fields available in Butler's distribute task alert messages.

New in Butler 15.0.0

Email notifications for distribute task success and failure were added in Butler 15.0.0.

Template fields

Butler uses the Handlebars library for templating work.

Handlebars offers a lot of useful features (nested template fields, evaluation context, template comments) and it's recommended that you browse through at least the language features section of their getting started guide to get a feeling for what's possible.

WARNING

Only email notifications currently support template files for distribute tasks.

If a template field is used for an alert type where that field is not supported, the field will simply be blank. No errors will occur, but it can still be tricky to debug if you're not aware of this.

The following template fields are available in distribute task alert messages.

FailedSuccessField nameDescription
hostNameServer on which the distribute task executed.
userUser ID running the task. Typically sa_scheduler for scheduled tasks.
taskIdID of distribute task.
taskNameName of distribute task.
appIdID of Sense app associated with the distribute task (if available).
appNameName of app (if available).
taskCustomPropertiesCustom properties that are present on the distribute task.
taskTagsTags that are present on the distribute task.
taskNextExecutionNext scheduled execution of the distribute task.
logTimeStampTimestamp as recorded in the Sense logs.
logLevelLog level of the Sense log file entry causing the alert.
logMessageLog message from the Sense log files.
executingNodeNameName of the server where the distribute task executed.
executionDuration.hoursDuration of task execution (hours part).
executionDuration.minutesDuration of task execution (minutes part).
executionDuration.secondsDuration of task execution (seconds part).
executionStartTime.startTimeUTCUTC timestamp for task start.
executionStartTime.startTimeLocal1Task start timestamp, format 1.
executionStartTime.startTimeLocal2Task start timestamp, format 2.
executionStartTime.startTimeLocal3Task start timestamp, format 3.
executionStartTime.startTimeLocal4Task start timestamp, format 4.
executionStartTime.startTimeLocal5Task start timestamp, format 5.
executionStopTime.stopTimeUTCUTC timestamp for task end.
executionStopTime.stopTimeLocal1Task end timestamp, format 1.
executionStopTime.stopTimeLocal2Task end timestamp, format 2.
executionStopTime.stopTimeLocal3Task end timestamp, format 3.
executionStopTime.stopTimeLocal4Task end timestamp, format 4.
executionStopTime.stopTimeLocal5Task end timestamp, format 5.
executionStatusNumFinal distribute task status code.
executionStatusTextFinal distribute task status message.
qlikSenseQMCLink to QMC, as defined in main config file.
qlikSenseHubLink to Hub, as defined in main config file.
genericUrlsLinks to other systems, as defined in main config file.

Example template

Here's a simplified example of a Handlebars template for distribute task failure emails:

handlebars
<h1>Qlik Sense distribution task failed</h1>

<table>
  <tr>
    <td><strong>Task name</strong><br />{{taskName}}</td>
    <td><strong>Task ID</strong><br />{{taskId}}</td>
  </tr>
  <tr>
    <td><strong>Task started</strong><br
      />{{executionStartTime.startTimeLocal1}}</td>
    <td><strong>Task ended</strong><br
      />{{executionStopTime.stopTimeLocal1}}</td>
  </tr>
  <tr>
    <td>
      <strong>Duration</strong><br />
      {{executionDuration.hours}}h
      {{executionDuration.minutes}}m
      {{executionDuration.seconds}}s
    </td>
    <td><strong>Executing node</strong><br />{{executingNodeName}}</td>
  </tr>
  <tr>
    <td><strong>Result</strong><br />{{executionStatusText}}</td>
    <td><strong>Log message</strong><br />{{logMessage}}</td>
  </tr>
</table>

<p><a href="{{qlikSenseQMC}}">Open QMC</a>
  |
  <a href="{{qlikSenseHub}}">Open Hub</a></p>

See the sample templates in Butler's src/config/email_templates directory for complete examples.

Released under the MIT License.