티스토리 뷰
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를 삭제하는 방법을 이용했다.
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"'
+ 내용 추가
- influx client에서 influx 명령어 실행
- 위 내용을 실행하고자 할 경우, 사전에 influx configuration 이 설정되어 있어야 함
- windows에서는 위 내용 그대로 작성했을 때 $(date+"%Y-%m-%dT%H:%M:%SZ") 했을 때, 에러 발생
ERROR) cannot be parsed as RFC3339~
해결법) 명확한 stop 시간을 정한다.
'influxdb' 카테고리의 다른 글
[influxdb] influxd 의 config 파일 설정 (0) | 2022.05.24 |
---|---|
[influxdb2.1] measurement, tag key, tag value 조회 (0) | 2022.01.26 |
[influxdb] API 를 이용하여 influxDB 접근 방법 (0) | 2022.01.14 |
[influxdb] Query InfluxDB with Flux (0) | 2022.01.14 |
[ InfluxDB ] InfluxDB 2.1 설치 방법 (0) | 2021.12.09 |