Hello team,
I need to send email every day with below status. can i know how i can achieve this using watcher.
Kibana Health check for **Todays Date** is **Green / Red /Yellow**.
PFA for detail log ingestion and cluster status report
Cluster Name: ABC
number_of_data_nodes 12
active_primary_shards 4567
active_shards 9678
relocating_shards 0
initializing_shards 0
unassigned_shards 0
delayed_unassigned_shards 0
number_of_pending_tasks 0
active_shards_percent_as_number 100
Something like this:
POST _watcher/watch/_execute
{
"watch": {
"trigger": {
"schedule": {
"interval": "1d"
}
},
"input": {
"http": {
"request": {
"scheme": "https",
"host": "mycluster.es.northamerica-northeast1.gcp.elastic-cloud.com",
"port": 9243,
"method": "get",
"path": "_cluster/stats",
"headers": {},
"auth": {
"basic": {
"username": "elastic",
"password": "xxxxxx"
}
}
}
}
},
"condition": {
"script": {
"source": "return true;"
}
},
"actions": {
"displayResults": {
"logging": {
"level": "info",
"text": """
cluster name: {{ctx.payload.cluster_name}}
number_of_hot_data_nodes: {{ctx.payload.nodes.count.data_hot}}
active_primary_shards : {{ctx.payload.indices.shards.primaries}}
"""
}
}
}
}
}
and also see example here for some more advanced calculations, etc.
Hi All,
We are able to generate data in a tabular format through a watcher
IndexName
StoreSize(in MB)
DocumentCount
index1
23
220
index-2
20
129
index-3
26
178
Is there any way in which we could add the total Store size and total document count separately and print that in the Watcher mail?
Regards,
Nalin
Hi @richcollier ,
Thanks for your confirmation. Can you please help me out for variable name for below fields.
GET _cat/nodes?v=true&s=name : ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
GET /_cat/allocation?v=true&s=node : shards disk.indices disk.used disk.avail disk.total disk.percent host ip node
system
(system)
Closed
January 9, 2023, 11:04am
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.