美文网首页
influxdb 写入数据

influxdb 写入数据

作者: Canon_2020 | 来源:发表于2020-04-20 09:44 被阅读0次
import requests

posturl = 'http://localhost:8086/write?db=jmeter'

str_val = """{"code":0,"msg":"success","data":null}"""

# influxdb 的字段类型需要一致
# data = 'response,httpCode=200 responseData="{}",requestHeaders="1",responseHeaders="1" '.format(str_val)
# data = '''response,httpCode=200 responseData="{}",requestHeaders="1",requestData="1",responseHeaders="1",test="1" '''.format(str_val)
data = '''response,requestHeaders=request_headers requestData="data",httpCode=200,responseHeaders="response_headers",responseData="{}" '''.format(str_val)
# data = 'response,httpCode=200 requestHeaders="1",responseHeaders="1" '
response = requests.post(posturl, data=data)

相关文章

网友评论

      本文标题:influxdb 写入数据

      本文链接:https://www.haomeiwen.com/subject/fsftwctx.html