influxDB -writing

Published by onesixx on

Write data

Load data source in UI

Load data source in UI

InfluxDB UI에서 각종 Sources의 데이터를 load한다.

  • Annotatied CSV , Line Protocol
  • [Client 라이브러리]를 선택하거나,
    (such as Python, Ruby, Scala, and more!)
  • [Telegraf 플러그인] 사용하여 데이터를 로드한다
    (like MQTT Consumer, MySQL, File, and many more!).

No-code solutions

Telegraf

input plugins – (Messaging, IoT) – MQTT

https://github.com/influxdata/telegraf/blob/release-1.20/plugins/inputs/mqtt_consumer/README.md

Scrape data

Code solution (Developer tools)

3rd party developer tools

Write raw query results back to InfluxDB

Write raw query results back to InfluxDB

https://docs.influxdata.com/influxdb/v2.1/write-data/developer-tools/csv/

https://docs.influxdata.com/influxdb/v2.1/reference/syntax/annotated-csv/#annotated-csv-in-flux

InfluxDB에 csv파일은 주입하려면, Cli의 influx write 명령사용.

CSV annotations은 맨 위줄에 추가된 정보. (어떤 컬럼이 measurement 이거나, field이거나, timestamp, 또는 tag set인지)

  • csv 파일 맨 위에 annotation
  • 명령어 뒤어 옵션으로 –header
  • 따로 파일로 -f header.csv를 만들어서

헤더 있는 Excel 파일

#datatype

  • measurement
  • tag
  • field
  • dateTime
  • ignored

필드 타입

Plain Text
ex.csv
Shell
ex.csv
Plain Text
Shell

Measuerment명 상수로 추가, 시간없는 날짜 필드

  • datatype dateTime:RFC3339 2020-01-01T00:00:00Z
  • datatype dateTime:RFC3339Nano 2020-01-01T00:00:00.000000000Z
  • datatype dateTime:number 1577836800000000000
  • datatype dateTime:2006-01-02 2020-01-01

  • constant measurement,m
  • constant tag,dataSource,csv

#constant measurement,m
#constant tag,dataSource,csv
Plain Text
ex.csv
Shell
Categories: Influxdb

onesixx

Blog Owner

guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x