InfluxDB 2.x: Delete data

Aus Wiki-WebPerfect
Wechseln zu: Navigation, Suche

Influx CLI

influx delete \
  --bucket <YOUR_BUCKET> \
  --org <YOUR_ORGANISATION> \
  --token '<YOUR_TOKEN>' \
  --start 1970-01-01T00:00:00Z \
  --stop $(date +"%Y-%m-%dT%H:%M:%SZ") \
  --predicate '_measurement="<MEASUREMENT>" and <MORE_FILTERS>'


PowerShell

$Header = @{Authorization = "Token <YOUR_TOKEN>"}
$Body = '{
        "start": "1970-01-01T00:00:00.00Z",
        "stop": "2022-00-01T00:00:00.00Z",
        "predicate": "_measurement=\"<MEASUREMENT>\" and <MORE_FILTERS>"
}'
 
Invoke-WebRequest -Uri 'http://<YOUR_INFLUXDB>:<INFLUXDB_PORT>/api/v2/delete?org=<YOUR_ORG>&bucket=<YOUR_BUCKET>' -Header $Header -Method POST -Body $Body -ContentType "application/json"