brief introduction

about Kibana Sometimes we want to pay attention to some fields , At this time, through the means of alarm, we can greatly improve the timeliness and reliability of understanding the status of these information . Use sentinl The plug-in can help us achieve this function .

This tutorial is based on sentinl 6.2.3 edition , sentinl The version is best with kibana The versions of are consistent .

sentinl Plug in download address :https://github.com/sirensolutions/sentinl/releases.

sentinl Document address :http://sentinl.readthedocs.io/en/latest/

Use steps

1. stay kibana Configuration on the interface sentinl, Click on the top right corner new establish watchers

2. Click on +watcher Create a new Watcher

3. Fill in General The page content , title yes watcher The name of ,Schedule It's the execution cycle .

4. Fill in input The page content , body Fill in ES Query statement , You can write corresponding query statements according to specific business

5. Fill in Condition The page content , payload.hits.total > 1 ( When the number of query results is greater than 1 when , Trigger Actions), You can set your own conditions .

6.Transform But for input Do some processing for the query results , Not used here , You can leave it blank

7. Fill in Actions The page content ,Actions Include webhook,email,email html,report,slack,console, Here is webhook.

7.1 Use webhook Hair rest request , You can choose get or post Two ways .

7.1.1 After filling in the corresponding data , Click on the Save Button .

7.1.2 You can click the single run button to test . The parameters received are shown below , Test success

7.2 Use webhook Execute the new watchers( Only once ), In the new watchers Zhongfa rest request .

path: /api/sentinl/watcher/_execute( Fixed value )

body Is as follows :

 {
"_source": {
"actions": {
"testRest": {
"throttle_period": "0h0m10s",
"webhook": {
"method": "POST",
"host": "127.0.0.1",
"port": ,
"proxy": false,
"path": "/kyle",
"body": "{\n \"id\":100,\n \"name\":\"kyle20\"\n}"
}
}
},
"input": {
"search": {
"request": {
"index": [
"movies"
],
"body": {
"query": {
"match_all": {}
}
}
}
}
},
"condition": {
"script": {
"script": "payload.hits.total > 1"
}
},
"transform": {},
"trigger": {
"schedule": {
"later": "every 5 minutes"
}
},
"disable": true,
"report": false,
"title": "watcher_title"
}
}

test result :

7.3 Use sentinl  Execute multiple watcher programme

principle : The first one. watcher Write the result of es index  in , For others watcher Use ( It can be used as a trigger for other watcher The way )

7.3.1  New first watcher, The contents are as follows :

 {
"actions": {
"New console action txv1ad1yazr": {
"throttle_period": "0h0m1s",
"console": {
"message": "{\n{{#payload.hits.hits}}\n\"name\":\"{{_source.name}}\",\n\"age\":{{_source.age}}\n{{/payload.hits.hits}}\n}"
}
},
"New webhook action 20wm9sojv9j": {
"throttle_period": "0h0m1s",
"webhook": {
"method": "POST",
"host": "127.0.0.1",
"port": ,
"proxy": false,
"path": "/twoindex/doc",
"body": "{\n{{#payload.hits.hits}}\n\"name\":\"{{_source.name}}\",\n\"age\":{{_source.age}}\n{{/payload.hits.hits}}\n}",
"save_payload": false,
"headers": {
"content-type": "application/json"
}
}
}
},
"input": {
"search": {
"request": {
"index": [
"trumantest"
],
"body": {
"query": {
"match": {
"age": ""
}
}
}
}
}
},
"condition": {
"script": {
"script": "payload.hits.total > 0"
}
},
"transform": {},
"trigger": {
"schedule": {
"later": "every 1 minutes"
}
},
"disable": false,
"report": false,
"title": "first_watcher"
}

first watcher  Mainly testing trumantest Does it contain "age": "19"  data , If there is , Write the result to twoindex  in .

7.3.2 Create a second watcher, Main detection index  Number , If it is greater than 1, It's in console  Medium output

 {
"actions": {
"New console action 34fsgrz5dhd": {
"throttle_period": "0h0m1s",
"console": {
"message": "this is a measage :{{payload.hits.total}}"
}
}
},
"input": {
"search": {
"request": {
"index": [
"twoindex"
],
"body": {
"query": {
"match_all": {}
}
}
}
}
},
"condition": {
"script": {
"script": "payload.hits.total > 1"
}
},
"transform": {},
"trigger": {
"schedule": {
"later": "every 1 minutes"
}
},
"disable": false,
"report": false,
"title": "two_watcher"
}

7.3.3 experimental result :

Kibana plug-in unit sentinl More articles on using the tutorial

  1. Kibana plug-in unit sentinl Realize email alarm

    Why do you suddenly want to use the abnormal content of the log for e-mail alarm , It's because the company's online business repeatedly locked tables last week , Development is optimizing sql At the same time , I'm also wondering if I can detect the abnormal content of the log and realize email alert . After searching for some information on the Internet , decision ...

  2. Kibana Plug in environment building tutorial

    original text Environmental background , Kibana 7.4.0, Elasticsearch 7.4.0 Be careful , When the following command is executed , Try to execute it in the command line window with the administrator's permission , Avoid some errors without permission ; 1. Get ready Kibana ...

  3. Sublime Text 2 Install Chinese cracking 、 Plug in package installation tutorial

    Original address : Sublime Text 2 Install Chinese cracking . Plug in package installation tutorial _ Experience in baidu http://jingyan.baidu.com/article/ff4116259b057c12e48237b8.ht ...

  4. Alibaba Java Develop specification plug-ins p3c Detailed tutorial and experience

    Alibaba Java Development Manual Before we get to the point of introducing this plug-in , First of all, let's talk about < Alibaba Java Development Manual >,2017 At the beginning of year , The first public official of Ali Java It can be said that the code specification standard manual has aroused the attention of the whole people (IT world ) Code rules ...

  5. 40 It's great jQuery Plug ins and making tutorials ( A series of )

    jQuery In the present Web Plays an important role in development projects ,jQuery Let the website have better usability and user experience , Let visitors leave a very good impression on the website .jQuery With many plug-ins . unique . Known for its lightweight and support for large-scale website development ...

  6. utilize kibana Plug in pairs Elasticsearch Inquire about

    utilize kibana Plug in pairs Elasticsearch Inquire about Elasticsearch It's a very powerful search engine , The purpose of using it is to quickly query the required data . Query classification : The basic query : Use Elasticsear ...

  7. ES 04 - install Kibana plug-in unit (6.6.0 edition )

    Catalog 1 Kibana What is it? 2 Install and start Kibana 2.1 Ready to install the package 2.2 Modify the configuration file 2.3 start-up Kibana And verify 2.4 close Kibana service 3 Kibana A functional test 3.1 About ...

  8. VS Add plug-ins Supercharger Crack tutorial

    VS Add plug-ins Supercharger Crack tutorial Supercharger Effect preview and download path : http://supercharger.tools/index.html Download address :https://vis ...

  9. Unity plug-in unit -NGUI Use the tutorial

    Unity plug-in unit -NGUI Use the tutorial This article provides the whole process , Chinese translation .Chinar Stick to a simple lifestyle , To the world !( Have a better reading experience -- For high resolution users, please adjust the scale of the web page according to your needs ) 1 NGUI A powerful secondary ...

Random recommendation

  1. C++ Function overloading and function templates

    1. function overloading This is an example written by a rookie . Function overloading should pay attention to the following : 1.1 Overloaded functions have similar functions : 1.2 Only the type of the parameter ( The number and type of formal parameters ) To overload a function , int max(int a,int b);flo ...

  2. Samba The network configuration

    Samba The network configuration Operating environment ubuntu14.04 1. to update Linux Source list sudo apt-get update 2. install Samba service sudo apt-get install samba ...

  3. Nine 、SDP

    1.      SDP 1.1       Service Overview SDP, Service Discovery Protocol, Service Discovery Protocol . 1.1.1    Concept SDP Provides a way to discover services and these available services ...

  4. Animator Window view Project View PlayerIdleAnimation and PlayerWalkingAnimation

    Animator Window view Project View PlayerIdleAnimation and PlayerWalkingAnimation Through the operation in the previous section , We built a new 2 An animation :PlayerIdleAnimat ...

  5. LINQ to SQL sentence (2) And Select/Distinct

    LINQ to SQL  sentence (2) And  Select/Distinct [1] Select  Introduce  1 [2] Select  Introduce  2 [3] Select  Introduce  3  and   Distinct  Introduce Se ...

  6. Python data structure ———— Implementation of binary search tree

    For each node of the binary search tree Node, All keywords in its left subtree are less than Node Key words of , All keywords in the right subtree are greater than Node Key words of . The average depth of a binary search tree is O(log N). 1. initialization class Bi ...

  7. Retrofit 2.0 throwing @Field parameters can only be used with form encoding

    Studying recently Retrofit2.0 Want to use Retrofit + Dagger2 + RxJava + ButterKnife Using refactoring projects together On the one hand, they have their own characteristics demo As business logic grows It's very messy On the other hand ...

  8. Ignore node.js In service favicon.icon Request

    scene One of the simplest node.js Of http service const http = require('http'); const server = http.createServer(function(req, ...

  9. spiral matrix Spiral matrix

    Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral or ...

  10. c groups

    https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt https://developer.ibm.com/hadoop/2017 ...