Hello,

Thank you for the answer!  It works now. The next step is that I would like 
to query the data from the previous day. I wanted to use node.offset(value 
time.Duration). But I am doing my query each hour, and I want always all 
the data from the previous day. Therefore, I would like a offset variable 
like:

offset = current_hour
then:

var error_eEC_h = batch

     |query('''

     SELECT sum(diff_eEC_h) as value1 FROM FMV_calcul."default"."error"

     ''')

     .period(1d)

     .cron('0 0 * * * * *')

     .groupBy(time(1d))
     .offset(current_hour)

Is there a way to do that?

Thank you

wug

kapacitor 0.13

   
















      .groupBy(time(1d))



Le vendredi 2 septembre 2016 19:02:28 UTC+2, [email protected] a écrit :
>
> The script looks correct. The cron uses local time for the timezone of the 
> Kapacitor process. To change the timezone for the process use the TZ env 
> var on Unix like systems.
>
> On Friday, September 2, 2016 at 8:18:28 AM UTC-6, wug wrote:
>>
>>   I am trying to define a batch task with Kapacitor which is execute 
>> each day at a certain time. First I am just trying to do a select using 
>> cron but this is not working (I have enabled the task).  Here the code: 
>>
>>
>>     batch
>>
>>         |query('''
>>
>>         SELECT distinct(value) as value FROM  
>> FMV_energy."default"."puissance.electricite"
>>
>>         WHERE "source" = 'FMV' AND "station" = 'siesa.consommation.PCV' 
>> AND "typeof" = 'forecast'
>>
>>         ''')
>>
>>         .period(2d)
>>
>>         .cron('0 5 16 * * * *')
>>
>>         .groupBy(time(15m))
>>
>>         .fill(0)
>>
>>
>> What am I doing wrong?
>>
>>
>> How have  I to manage the timezone in Kapacitor? It should be the problem?
>>
>>
>> Thank you
>>
>>
>> wug
>>
>>
>>
>>
>>

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
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/eb8ac347-524e-4d35-b037-c9cc498b3ab5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to