Discussion:
[influxdb] How to post CSV file data into the InfluxDB server in same time series as CSV File's time series?
s***@oztron.net
2018-01-08 04:42:34 UTC
Permalink
I would like to post data from a CSV file to InfluxDB file and the Time
column of InfluxDB should match with CSV file Time column. I meant InfluxDB
time series should same as CSV file's Time series.

My main motive is InfluxDB should store the data of CSV file with respect
CSV file's time series.

The CSV file like is shown below
Time Energy Power
12-26-2017 7:34:27 103691 24.838
12-26-2017 7:35:28 103693 19.525



I have used this spice code to convert CSV file's time to epoch to send the
InfluxDB server.

t = "2017-12-26 07:34:27"
lctime = (int(time.mktime(time.strptime(t,"%Y-%m-%d %H:%M:%S")))) * 1000000000 #in nano second


and I have posted this data to InfluxDB server in JSON format.

client.write_points([
{"measurement": "Meter1",
"tags":{"host": "localPC",
"Region": "Northam"},
"Time":lctime,
"fields":{"Energy": e1,
"Power": p1,
}
}
]

Enter code here...
There was no issue with posting these data to InfluxDB server but when I
went to check whether the correct data was written or not into Influxdb
using this query in database panel.
Select * From Meter1


The influxDB showed me this "*2018-01-04T05:43:41.580065574Z*" time but it
should have been shown me "2017-12-26 07:34:27" as same as CSV file's time.

Please tell me in which method I can math the time of CSV and InfluxDB?
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/991ac55a-3bb9-4205-a3f1-e8a7b1bce52d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sanford Whiteman
2018-01-08 16:09:56 UTC
Permalink
<html><head><meta http-equiv="Content-Security-Policy" content="script-src 'self'; img-src * cid: data:;"><meta http-equiv="Content-Security-Policy" content="script-src 'self'; img-src * cid: data:;"></head><body contenteditable="false" style="background-color: rgb(255, 255, 255); background-image: initial; line-height: initial;"><div id="response_container_BBPPID" style="outline:none;font-size:initial;font-family:&quot;Calibri&quot;,&quot;Slate Pro&quot;,sans-serif,&quot;sans-serif&quot;" dir="auto" contenteditable="false"> <div name="BB10" id="BB10_response_div_BBPPID" dir="auto" style="width: 100%; padding: initial; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"><span style="background-color: rgb(255, 255, 255); font-family: Calibri, &quot;Slate Pro&quot;, sans-serif, sans-serif; font-size: initial; text-align: initial;">"Time" !== "timestamp"</span></div><div name="BB10" id="BB10_response_div_BBPPID" dir="auto" style="width: 100%; padding: initial; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"><br></div><div name="BB10" id="BB10_response_div_BBPPID" dir="auto" style="width: 100%; padding: initial; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);">-- Sandy</div> <div name="BB10" id="response_div_spacer_BBPPID" dir="auto" style="width: 100%; padding: initial; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"> <br style="display:initial"></div> <div id="blackberry_signature_BBPPID" name="BB10" dir="auto"> <div id="_signaturePlaceholder_BBPPID" name="BB10" dir="auto" style="padding: initial; font-size: initial; text-align: initial; background-color: rgb(255, 255, 255);"></div> </div></div><!--start of _originalContent --></body></html>

<p></p>

-- <br />
Remember to include the version number!<br />
--- <br />
You received this message because you are subscribed to the Google Groups &quot;InfluxData&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:influxdb+***@googlegroups.com">influxdb+***@googlegroups.com</a>.<br />
To post to this group, send email to <a href="mailto:***@googlegroups.com">***@googlegroups.com</a>.<br />
Visit this group at <a href="https://groups.google.com/group/influxdb">https://groups.google.com/group/influxdb</a>.<br />
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/influxdb/E1eYZzs-wSEUBl-1A%40message-id.smtpcorp.com?utm_medium=email&utm_source=footer">https://groups.google.com/d/msgid/influxdb/E1eYZzs-wSEUBl-1A%40message-id.smtpcorp.com</a>.<br />
For more options, visit <a href="https://groups.google.com/d/optout">https://groups.google.com/d/optout</a>.<br />
s***@oztron.net
2018-01-09 04:19:53 UTC
Permalink
I'm not getting you. can you please tell me in details?
Post by Sanford Whiteman
"Time" !== "timestamp"
-- Sandy
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/d9e96f86-553c-4a6c-94e0-66ce90994a90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sanford Whiteman
2018-01-09 04:33:01 UTC
Permalink
The field is not called `Time`, it's `timestamp`, as shown in the API
docs.
--
Remember to include the version number!
---
You received this message because you are subscribed to the Google Groups "InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/1785075568.20180108233301%40figureone.com.
For more options, visit https://groups.google.com/d/optout.
Loading...