Last active
September 12, 2018 13:46
-
-
Save perzizzle/6a881edcf2300dcc1ceed098d66ef5b3 to your computer and use it in GitHub Desktop.
Example template for sideloading a value for threshold
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //template | |
| var data = batch | |
| |query(query) | |
| .period(window) | |
| .every(every) | |
| .groupBy(groups) | |
| |sideload() | |
| .source(path) | |
| .order(file) | |
| .field(key, default) | |
| data | |
| |alert() | |
| .warn(criteria) | |
| .id(id) | |
| .message(msg) | |
| .details(details) | |
| .exec(exe, script, event_class) | |
| //abridged task | |
| template-id: value_sideload | |
| dbrps: | |
| - db: 'telegraf' | |
| rp: 'autogen' | |
| vars: | |
| query: | |
| type: string | |
| value: 'SELECT * FROM "telegraf"."autogen"."infra_mq_queue"' | |
| groups: | |
| type: list | |
| value: | |
| - type: string | |
| value: 'host' | |
| - type: string | |
| value: 'queue_mgr' | |
| - type: string | |
| value: 'queues' | |
| window: | |
| type: duration | |
| value: 5m | |
| every: | |
| type: duration | |
| value: 1m | |
| path: | |
| type: string | |
| value: 'file:/app/uid/kapacitor/sideload' | |
| file: | |
| type: string | |
| value: '{{.queues}}.yml' | |
| key: | |
| type: string | |
| value: 'depth_threshold' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment