当前位置:网站首页>Influxdb2 sources add data sources
Influxdb2 sources add data sources
2022-07-03 14:59:00 【Allen electronic IOT studio】
It is mainly divided into the following ways :
1、 Upload files
2、 client API: This tutorial mainly adds data in this way
3、telegraf plug-in unit , Telegraph plug-in
With C# Take the client as an example :

Choose to generate API token:


Then return to this interface :
establish vs2019 Console Application :

Actual test findings /netframework4.5 Cannot install this nuget package :
Adjusted for 4.7.2 after .

C# The code is as follows :
// You can generate an API token from the "API Tokens Tab" in the UI
const string token = "oskR6XS-LT5myc6RwWwb0QTvKSsoWvfxklNXgkknYgzZJyk0K80IKhFQuMSGexfjCSRCO-xUHA0MFL0LG5BlFA==";
const string bucket = "scada_bucket";
const string org = "ghy";
// Get client object
var client = InfluxDBClientFactory.Create("http://124.223.23.44:8086", token);
// Writing data
const string data = "mem,host=host1 used_percent=23.43234543";
using (var writeApi = client.GetWriteApi())
{
writeApi.WriteRecord(bucket, org, WritePrecision.Ns, data);
}
Console.WriteLine("ok");Write successfully :

Use node-red Client to test :
Install nodes :node-red-contrib-influxdb

contain 3 Nodes :
Write operations :
The information above is wrong :

Set node information :
The overall process is as follows :
Test whether the write is successful :
Use the output node to view :
The overall process is as follows :
The timestamp node remains the default .
The configuration of the setting node is as follows :

The query statement is as follows :
from(bucket: \"scada_bucket\") |> range(start: -1h)The output node is configured as follows ;

Passing the above test has no result :
Report errors :
Be careful : The query function has not passed the test for the time being , But the data is really inserted .
边栏推荐
- [wechat applet] wxss template style
- Zzuli:1041 sum of sequence 2
- 牛客 BM83 字符串变形(大小写转换,字符串反转,字符串替换)
- Center and drag linked global and Chinese markets 2022-2028: Research Report on technology, participants, trends, market size and share
- There are links in the linked list. Can you walk three steps faster or slower
- Global and Chinese markets for transparent OLED displays 2022-2028: Research Report on technology, participants, trends, market size and share
- Tensor 省略号(三个点)切片
- TPS61170QDRVRQ1
- Dllexport et dllimport
- Pytorch深度学习和目标检测实战笔记
猜你喜欢

Analysis of gene family characteristics - chromosome location analysis

Byte practice plane longitude 2

The picture quality has been improved! LR enhancement details_ Lightroom turns on AI photo detail enhancement: picture clarity increases by 30%

Pytorch深度学习和目标检测实战笔记

Open under vs2019 UI file QT designer flash back problem

Rasterization: a practical implementation (2)

4-33--4-35

Zero copy underlying analysis

分布式事务(Seata) 四大模式详解

CentOS7部署哨兵Redis(带架构图,清晰易懂)
随机推荐
Time conversion ()
Yolov5系列(一)——网络可视化工具netron
The picture quality has been improved! LR enhancement details_ Lightroom turns on AI photo detail enhancement: picture clarity increases by 30%
Zero copy underlying analysis
从书本《皮囊》摘录的几个句子
7-3 rental (20 points)
Yolov5进阶之八 高低版本格式转换问题
406. Reconstruct the queue according to height
Zzuli:1047 logarithmic table
Centos7 deployment sentry redis (with architecture diagram, clear and easy to understand)
Zzuli:1041 sum of sequence 2
Tencent internship interview sorting
[ue4] HISM large scale vegetation rendering solution
4-29——4.32
Joomla! CMS 3.0~3.4.6 RCE
Adobe Premiere Pro 15.4 has been released. It natively supports Apple M1 and adds the function of speech to text
Class part2
B2020 分糖果
[engine development] in depth GPU and rendering optimization (basic)
How to color ordinary landscape photos, PS tutorial