How to transfer the data from json to influxdb

I have json file with no time column. Is it possible to transfer the data into InfluxDB using any command or utility in Linux or Ubuntu?
How to transfer the json file into influxdb?

If you don’t mind what timestamps are used, you can import the data as is and whatever “now” is will get applied to the data. If that won’t matter to you, then you might be in luck.

Can you share the first 2-3 records of the Json file? Please use a linter and paste it inside a code block </> here in your reply so it’s easily readable .

This is my sample json file. I am new to the influxdb and json. My requirement is to load the json into influx database. so, i tried with simple file first. I have seen the telegraf plugin but not sure how to use it. Is there any cli command or utitlity to load the file?

Blockquote{
“Stud Report”: {
“id”: 1001,
“Subjects”: [{
“sub-id”: 001,
“name”: “Math”
“time_val”: curr_time
}]
}
}

This will need some translation to get it into influxdb from what I’ve learned so far. It’s nested which makes it more challenging to deal with.

There’s 3 main parts to the dB design

It’s a big if, but if there are sufficient post process parsers to handle this format, you might be able to use telegraf

More likely though, you’ll probably need to write you’re own script to parse it (eg in python) into line protocol records, and then use one of the web modules to then write it into influxdb . The v2 api is documented here:

1 Like