InfluxDB 2.x: Delete data: Unterschied zwischen den Versionen

Aus Wiki-WebPerfect
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „ == Influx CLI == <source lang="bash"> influx delete \ --bucket <YOUR_BUCKET> \ --org <YOUR_ORGANISATION> \ --token '<YOUR_TOKEN>' \ --start 1970-01-01…“)
 
Zeile 1: Zeile 1:
 
 
== Influx CLI ==
 
== Influx CLI ==
 
<source lang="bash">
 
<source lang="bash">
Zeile 9: Zeile 8:
 
   --stop $(date +"%Y-%m-%dT%H:%M:%SZ") \
 
   --stop $(date +"%Y-%m-%dT%H:%M:%SZ") \
 
   --predicate '_measurement="<MEASUREMENT>" and <MORE_FILTERS>'
 
   --predicate '_measurement="<MEASUREMENT>" and <MORE_FILTERS>'
 +
</source>
 +
 +
 +
== PowerShell ==
 +
<source lang="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://xppl0210.xaas.swissic.ch:80/api/v2/delete?org=Inventx AG&bucket=test_bucket' -Header $Header -Method POST -Body $Body -ContentType "application/json"
 
</source>
 
</source>
  

Version vom 22. März 2021, 11:55 Uhr

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://xppl0210.xaas.swissic.ch:80/api/v2/delete?org=Inventx AG&bucket=test_bucket' -Header $Header -Method POST -Body $Body -ContentType "application/json"