Completion Rule Examples
The following rules are evaluated and applied when a query goes into any completion state: done, cancel, or error.
Setting a Query Tag
The following completion rule, completion_tag_short_query, sets a query tag Subsecond Query when queries run by non-superusers complete in less than 1 second.
For every subsecond query that runs, the administrator sees:

Log a Warning Message for the yellowbrick User
This completion rule, completion_warn_yellowbrick_user, tracks all of the queries run by the yellowbrick account and logs a warning message.
Rule Preview:
if (w.user === 'yellowbrick') {
log.warn('Running as yellowbrick!');
}For every query run by the yellowbrick account, the administrator sees:

Parent topic:Rule Examples