{
  "_ui": {
    "fieldName": [
      {
        "label": "products.price"
      }
    ],
    "aggregationType": "min",
    "index": [
      {
        "health": "green",
        "label": "kibana_sample_data_ecommerce",
        "status": "open"
      }
    ],
    "timeField": "order_date",
    "bucketUnitOfTime": "d",
    "bucketValue": 1,
    "watchType": "graph",
    "thresholdEnum": "BELOW",
    "groupedOverFieldName": "bytes",
    "groupedOverTop": 5,
    "overDocuments": "all documents",
    "topHitsAgg": {
      "field": [],
      "size": 5,
      "order": "asc"
    },
    "thresholdValue": 10
  },
  "trigger": {
    "schedule": {
      "cron": [
        "0 */1 * * * ?"
      ]
    }
  },
  "checks": [
    {
      "type": "search",
      "name": "mysearch",
      "target": "mysearch",
      "request": {
        "indices": [
          "kibana_sample_data_ecommerce"
        ],
        "body": {
          "size": 0,
          "aggregations": {
            "metricAgg": {
              "min": {
                "field": "products.price"
              }
            }
          },
          "query": {
            "bool": {
              "filter": {
                "range": {
                  "order_date": {
                    "gte": "now-1d",
                    "lte": "now"
                  }
                }
              }
            }
          }
        }
      }
    },
    {
      "type": "condition",
      "name": "mycondition",
      "source": "data.mysearch.aggregations.metricAgg.value < 10"
    }
  ],
  "actions": [
    {
      "type": "webhook",
      "name": "myslack",
      "throttle_period": "1s",
      "request": {
        "method": "POST",
        "url": "https://hooks.slack.com/services/token",
        "body": "{\"text\": \"Minimum product price over 1 day among {{data.mysearch.hits.total.value}} products: {{mysearch.aggregations.metricAgg.value}}.\"}",
        "headers": {
          "Content-type": "application/json"
        }
      }
    }
  ],
  "active": true,
  "log_runtime_data": false,
  "_id": "min_product_price_graph"
}
