@stephenb, I want the variable for which the alert is triggered.
It would be better if we not take the example of the log threshold. The actual use-case I am looking is the inventory.
[
{
"@timestamp": "2020-09-24T17:03:33.790Z",
"host": {
"name": "server1"
},
"customField": "customValue1",
"event": {
"duration": 143911,
"dataset": "system.cpu",
"module": "system"
},
"metricset": {
"name": "cpu",
"period": 10000
},
"service": {
"type": "system"
}
},
{
"@timestamp": "2020-09-24T17:03:33.790Z",
"host": {
"name": "server2"
},
"customField": "customValue2",
"event": {
"duration": 143911,
"dataset": "system.cpu",
"module": "system"
},
"metricset": {
"name": "cpu",
"period": 10000
},
"service": {
"type": "system"
}
},
{
"@timestamp": "2020-09-24T17:03:33.790Z",
"host": {
"name": "server3"
},
"customField": "customValue3",
"event": {
"duration": 143911,
"dataset": "system.cpu",
"module": "system"
},
"metricset": {
"name": "cpu",
"period": 10000
},
"service": {
"type": "system"
}
},
{
"@timestamp": "2020-09-24T17:03:33.790Z",
"host": {
"name": "server1"
},
"customField": "customValue1",
"event": {
"duration": 143911,
"dataset": "system.cpu",
"module": "system"
},
"metricset": {
"name": "cpu",
"period": 10000
},
"service": {
"type": "system"
}
},
{
"@timestamp": "2020-09-24T17:03:33.790Z",
"host": {
"name": "server1"
},
"customField": "customValue1",
"event": {
"duration": 143911,
"dataset": "system.cpu",
"module": "system"
},
"metricset": {
"name": "cpu",
"period": 10000
},
"service": {
"type": "system"
}
},
{
"@timestamp": "2020-09-24T17:03:33.790Z",
"host": {
"name": "server1"
},
"customField": "customValue1",
"event": {
"duration": 143911,
"dataset": "system.cpu",
"module": "system"
},
"metricset": {
"name": "cpu",
"period": 10000
},
"service": {
"type": "system"
}
}
]
This is a sample metric-beat JSON with limited information. Let's assume server1 and server3 are reaching the threshold for CPU utilization. So when the alert is triggered for both of these events I want to get customField values for corresponding servers (server1 = customValue1 and server3 = customValue3).