On the bottom of this example, in the actions section, I sort through all the snapshots in an S3 bucket, end goal is to send an alert to victorops if I have a failed snapshot. I finally figured out how to write out every state of each snapshot, but can't figure out how to do a compare to show only the ones that have failed. Here is an example of what I'm trying to do that currently does not work.
{
"trigger": {
"schedule": {
"interval": "60s"
}
},
"input": {
"http": {
"request": {
"scheme": "http",
"host": "analytics.devc.openwhere.net",
"port": 9200,
"method": "get",
"path": "/_snapshot/s3_repository/_all",
"params": {},
"headers": {}
}
}
},
"condition": {
"compare": {
"{{#ctx.payload.snapshots}}{{state}}{{/ctx.payload.snapshots}}": {
"eq": "FAILED"
}
},
"actions": {
"logging": {
"logging": {
"level": "info",
"text": " Snapshot Sate: {{#ctx.payload.snapshots}}{{state}}{{/ctx.payload.snapshots}}"
}
}
}
}
}
The other questions is even when I get the compare to work would it print every snapshot state or just the ones that matched the condition?