Sentinl watcher tutorial

Content

Versions

What is a watcher

First watcher

Step by step

Create visualization

Spy_wizard

Understanding the Sentinl UI

Sentinl user interface

Monitoring

Alarms tab

Visualizing alarm count

Creating

{
  "search": {
    "request": {
      "index": [],
      "body": {}
    }
  }
}
{
"size": 0,
"_source": {
  "excludes": []
},
"aggs": {
  "2": {
    "date_histogram": {
      "field": "@timestamp",
      "interval": "1m",
      "time_zone": "Europe/Berlin",
      "min_doc_count": 1
    }
  }
},
"stored_fields": [
  "*"
],
"script_fields": {},
"docvalue_fields": [
  "@timestamp"
],
"query": {
  "bool": {
    "must": [
      {
        "match_all": {}
      },
      {
        "range": {
          "@timestamp": {
            "gte": 1529645280668,
            "lte": 1529648880668,
            "format": "epoch_millis"
          }
        }
      }
    ],
    "filter": [],
    "should": [],
    "must_not": []
  }
}
}
"request": {
    "index": [
      "logstash-2018.06.19",
      "logstash-2018.06.20"
    ],
    "body": {"..."}
  }
"range": {
        "@timestamp": {
          "gte": 1529645280668,
          "lte": 1529648880668,
          "format": "epoch_millis"
        }
      }
"range": {
        "@timestamp": {
          "gte": "now-1h/h",
          "lte": "now/h",
        }
      }

Copying the visualization

Ready to paste

    {
  "search": {
    "request": {
      "index": [],
      "body": {
  "size": 0,
  "_source": {
    "excludes": []
  },
  "aggs": {
    "2": {
      "date_histogram": {
        "field": "@timestamp",
        "interval": "1m",
        "time_zone": "Europe/Berlin",
        "min_doc_count": 1
      }
    }
  },
  "stored_fields": [
    "*"
  ],
  "script_fields": {},
  "docvalue_fields": [
    "@timestamp"
  ],
  "query": {
    "bool": {
      "must": [
        {
          "match_all": {}
        },
        {
          "range": {
            "@timestamp": {
              "gte": 1529645280668,
              "lte": 1529648880668,
              "format": "epoch_millis"
            }
          }
        }
      ],
      "filter": [],
      "should": [],
      "must_not": []
    }
  }
}
    }
  }
}
{
  "took": 5,
  "timed_out": false,
  "_shards": {
    "total": 15,
    "successful": 15,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 1380,
    "max_score": 0,
    "hits": []
  },
  "status": 200
}
{
  "script": {
    "script": "payload.hits.total < 200"
  }
}
{
  "compare": {
    "payload.hits.total": {
      "lt": 200
    }
  }
}

Watcher administration

Action image
(Action buttons listed with each watcher. (Edit, Execute, Delete, Disable))

Edit watcher

Execute watcher

Delete watchers

Disable watcher

Date math

"range": {
    "@timestamp": {
      "gte": 1529488800000,
      "lte": 1530183600000,
      "format": "epoch_millis"
    }
}
"range": {
    "@timestamp": {
      "gte": "now-193h/h",
      "lte": "now/h"
    }
}

Date math

Elasticsearch datemath

"index": [
  "<logstash-{now/d}>",
  "<logstash-{now/d-1d}>"
]

Guides and tutorials