How to insert data in daily partitions

I have large amount of data.I want to partition data monthly,daily,yearly.

Hello @Emam_H,
Welcome!
What do you mean by partition? Can you please elaborate?
Are you using 1.x or 2.x?

Hello Anaisdg,

I have likely the same question like Emam_H had, and I would answer your counter-questions :wink:
The partitions ar meant as kind of “accumulation registers” or “accumulating variables”.

My use case: every 5 Minutes, I have electrical and physical data from telegraf to influxdb as well as from an ESP8266 directly to influxdb.
Both sources send data which should be “summed up” or “accumulated” or “integral culculated” (sorry for my English); at the end of day, week, month and year, I’d like to get the summed-up-in-time values.

Best to give what I want as an example:

  • Today solar production: 1 kWh, total power consumption 2 kWh
  • Last calendar week solar production: 6 kWh, total power consumption 10 kWh
  • Last calendar month solar production: 25 kWh, total power consumption 33 kWh
  • Last calendar year solar production: 400 kWh, total power consumption 555 kWh

as well as

  • Last 7 days solar production: 5 kWh, total power consumption 11 kWh
  • Last 30 days solar production: 26 kWh, total power consumption 31 kWh
  • Last 365 days solar production: 414 kWh, total power consumption 500 kWh
  1. So my investigation did not find help in the Aggregator Plugins of Telegraf, despite this sounds to be the best place.
  2. Next I heard about Capacitor, but didn’t understood for now, if it could help me.
  3. “flux” was found in the board search, but I am uncertain, if this is a script running inside InfluxDB and where to start, and if it could handle end-of-day, end-of-week aggregations and so on.
  4. Grafana is not the place where I’d like to solve the task, because I offer the InfluxDB to other applications and would like to have the summed-up statistics there.

long to read, short question:
What is the best/easiest way and tool to solve my task?

Cheers,
Daisy

@daisy_rz

I would recommend you read and try out (on some test data) the following functions. Everything is explained in detail and applies to what you have written above.

@grant1
Thank you very much! flux is exactly what I want and the given descriptions are nearly perfect!

The only thing I need to discover is a “year-so-far” window which starts absolute and ends relative. But this is only an option I could omit. Or it will even work with absolute start (1.1.this year) and absolute end (future 31.12.this year), I’ll see it soon…

Again, thank you for the nice, helpful and very fast reply!!

Yours,
Daisy