Name: honeytrigger
Owner: Honeycomb
Description: CLI for managing honeycomb triggers.
Created: 2018-03-28 22:39:04.0
Updated: 2018-04-12 18:04:01.0
Pushed: 2018-04-12 18:04:00.0
Homepage: http://honeycomb.io
Size: 51
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
honeytrigger
provides a simple interface for managing Honeycomb triggers
Warning: This tool is based upon the experimental Triggers API. It has not been released and is subject to change at any time. Use at your own risk.
get github.com/honeycombio/honeytrigger
neytrigger # (if $GOPATH/bin is in your path.)
$ honeytrigger -k <your-writekey> -d <dataset> COMMAND [command-specific flags]
<your-writekey>
can be found on https://ui.honeycomb.io/account<dataset>
is the name of one of the datasets associated with the team whose writekey you're using.COMMAND
see below| Command | Description |
| ——– | ———– |
| apply
| create/update triggers from a config file |
| list
| print a list of all trigger names |
| export
| dump the existing trigger config in JSON format |
apply
)First, create a config file defining your triggers. If this seems daunting, try creating a trigger you want in the UI and then using the export
command to generate the config:
"triggers": [
{
"name": "Trigger 1",
"description": "helpful description of this trigger",
"frequency": 300,
"query": {
"breakdowns": [
"user",
],
"calculations": [
{
"op": "COUNT"
}
],
"filters": [
{
"column": "user",
"op": "=",
"value": "root"
}
]
},
"threshold": {
"op": ">",
"value": 0
},
"recipients": [
{
"type": "email",
"target": "me@example.com"
}
]
},
{
"name": "Trigger 2",
"description": "something something\nsomething",
"frequency": 300,
"query": {
"breakdowns": [
"user",
],
"calculations": [
{
"op": "COUNT"
}
],
"filters": [
{
"column": "user",
"op": "!=",
"value": "root"
}
]
},
"threshold": {
"op": ">",
"value": 0
},
"recipients": [
{
"type": "email",
"target": "me@example.com"
}
]
}
]
Triggers that already exist will be updated. Triggers that do not exist will be created. Currently, deleting triggers is not supported.
Example:
honeytrigger -k ${WRITE_KEY} -d mydataset apply -f config.json
ng trigger 'Trigger 2'
ting trigger 'Trigger 1' with id Euex2tHuEuy
list
)Just print a list of triggers by name.
Example:
honeytrigger list -k ${WRITE_KEY} -d mydataset
ger 1
ger 2
export
)You can use this to generate a JSON config suitable for use by apply
.
Example:
honeytrigger export -k ${WRITE_KEY} -d mydataset
d":"Euex2tHuEuy","threshold":{"value":0,"op":"\u003e"},"description":"something something something","frequency":300,"name":"Trigger 1","recipients":[{"type":"email","target":"me@example.com"}],"query":{"calculations":[{"op":"COUNT"}],"filters":[{"value":"root","op":"=","column":"user"}],"breakdowns":["user"]}},{"id":"BtFqDeE7SjU","threshold":{"value":0,"op":"\u003e"},"description":"something else","frequency":300,"name":"Trigger 2","recipients":[{"type":"email","target":"me@example.com"}],"query":{"calculations":[{"op":"COUNT"}],"filters":[{"value":"root","op":"!=","column":"user"}],"breakdowns":["user"]}}]