Ok I have been making some baby steps as I would like to use influxdb and kapacitor for a project I am working on. However I can’t figure or even hack my way around .post returning an empty array.
These are my scripts:
dbrp "TEST_MEASUREMENTS"."autogen"
batch
|query('''
SELECT mean(data)
FROM "TEST_MEASUREMENTS"."autogen"."temperature"
WHERE processed != true
''')
.period(5h)
.every(1m)
.groupBy('my_id')
|alert()
.crit(lambda: "mean" > 30)
.message('observableName: {{.Name}} mean: {{index .Fields "mean"}} myId: {{index .Tags "my_id"}}')
.post('http://localhost/api/post-alerts')
.log('/tmp/alert_temp')
This triggers the alert and is logged but the post parameters are empty. This is a php script I try to use to extract it:
$data = $this->params()->fromPost();
error_log("Data: $data");
The array returned is empty. Though it logs correctly. This is a similar problem to what I have: influxdb - Kapacitor .post() HTTP Post to url not sending data - Stack Overflow but the answer is not relevant to me.