Missing value although using Batch

windows
kapacitor
#1

I am using batch node to query data from InfluxDB over a specified period. The following is a short example:

 batch
                
                |query(
                        '''
                       SELECT "timeUntilEndOfLicence"
                                 

                       FROM "artifactory__systems"."autogen".Artifactory
                        '''
                        )
                        .period(9m)
                        .every(20s)

                  |last('timeUntilEndOfLicence')
                         .as('timeUntilEndOfLicence')
..............

In this Tickscript I do calculations in an eval-node with the field timeUntilEndOfLicence. The result field called “licenceStatus” is pushed to InfluxDB to the same database with the same measurement (artifactory__systems".“autogen”.Artifactory). In another Tickscript I do the same calculating for another field and push the result field called “storageStatus” to InfluxDB. All works fine.

In another Tickscript I want to combine “licenceStatus” and “storageStatus” to do further processing. The way I access these fields is exactly the same as stated above using batch, period and last node. Nevertheless kapacitor log shows that the fields licenceStatus and storageStatus are missing. Checking the logs and InfluxDB entries these fields seem to be available though.

Here https://github.com/influxdata/kapacitor/issues/1217 they had a similar problem and suggest using batch instead of stream as solution. It seems that there still are some problems with batch.

#2

Some other example:

I use this tickscript to get the cpu_idle value and do some processing with it. Then a new field is sent to InfluxDB:

 batch
                
               |query(
                        '''
                       SELECT "cpu_idle"
                                 

                       FROM  "telegraf"."autogen"."cpu"
                        '''
                        )
                        .period(2m)
                        .every(20s)

                  |last('cpu_idle')
                         .as('cpu_idle')

                  |eval(
                          lambda: int("cpu_idle" < 40)
                         )
                         .as('result')
                  
                   |influxDBOut()
                        .database('telegraf')
                        .retentionPolicy('autogen')
                        .measurement('cpu')

In the second Tickscript I want to access the field result, wich was just posted by the first Tickscript to InfluxDB.

batch
                
               |query(
                        '''
                       SELECT "result"
                                 

                       FROM  "telegraf"."autogen"."cpu"
                        '''
                        )
                        .period(2m)
                        .every(20s)

                  |last('result')
                         .as('result')

                  |eval(
                          lambda: int("result" < 1)
                         )
                         .as('test')
                  
                  |influxDBOut()
                        .database('telegraf')
                        .retentionPolicy('autogen')
                        .measurement('cpu')

This leads to the following error:
E! field result missing from point, skipping batch