티스토리 뷰

반응형

influxdb를 테스트하고 있어서, 생성한 measurement를 삭제해야 하는데... 괜찮은 방법을 찾지 못했다.

influx에서 column을 삭제하는 방법으로 measurment를 drop하는 방법이 있는데...

https://docs.influxdata.com/flux/v0.x/stdlib/universe/drop/#tables

 

drop() function | Flux 0.x Documentation

drop() functionThe drop() function removes specified columns from a table. Columns are specified either through a list or a predicate function. When a dropped column is part of the group key, it will be removed from the key. If a specified column is not pr

docs.influxdata.com

 

 

 

 

좀 더 쉬운 방법이 없을까.....?

 

 

 

그래서influxCLI를 이용하여 특정 기간에 생성된 measurement를 삭제하는 방법을 이용했다. 

https://docs.influxdata.com/influxdb/v2.1/reference/cli/influx/delete/#delete-points-in-a-measurement-with-a-specific-tag-value

 

influx delete | InfluxDB OSS 2.1 Documentation

 

docs.influxdata.com

influx delete \
  --bucket stream \
  --start 1970-01-01T00:00:00Z \
  --stop $(date+"%Y-%m-%dT%H:%M:%SZ") \
  --predicate '_measurement="test1"'

[influxCLI 를 이용하여 특정 measurement 삭제]

 

 

 

+ 내용 추가

- influx client에서 influx 명령어 실행 

- 위 내용을 실행하고자 할 경우, 사전에 influx configuration 이 설정되어 있어야 함

- windows에서는 위 내용 그대로 작성했을 때  $(date+"%Y-%m-%dT%H:%M:%SZ") 했을 때, 에러 발생

ERROR) cannot be parsed as RFC3339~

해결법) 명확한 stop 시간을 정한다. 

 

반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2024/10   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함