kibana告警郵件-mustache語法

一、kibana告警郵件設置

在這裏插入圖片描述

二、mustache語法

【官方文檔】mustache語法說明

1. 引用變量

{{&ctx.results.0.hits.total}}

2. 取數組的值

{{&ctx.results.0.hits.total}}

3. for循環

{{#ctx.results.0.hits.hits}}

三、使用樣例

1. 從kibana日誌中檢索某關鍵詞,並返回所有符合條件的message

出現次數:{{&ctx.results.0.hits.total}}

message如下:
{{#ctx.results.0.hits.hits}}
  {{_source.s_message}}
{{/ctx.results.0.hits.hits}}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章