# TICKscript doesn't seems to be running correctly

**URL:** <https://community.influxdata.com/t/tickscript-doesnt-seems-to-be-running-correctly/6312>\
**Category:** Telegraf\
**Created:** [August 21, 2018, 3:03pm UTC](https://community.influxdata.com/t/tickscript-doesnt-seems-to-be-running-correctly/6312 "2018-08-21T15:03:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Voolkanus](https://avatars.discourse-cdn.com/v4/letter/v/65b543/32.png) [@Voolkanus](https://community.influxdata.com/u/Voolkanus)\
**Post date:** [August 21, 2018, 3:03pm UTC](https://community.influxdata.com/t/tickscript-doesnt-seems-to-be-running-correctly/6312/1 "2018-08-21T15:03:16Z")

</div>

Hi,  
I’m trying to build a quite simple script, however it doesn’t seems to be running, I’m receiving the following error in the watch logs for the task:  
lvl=error msg=“failed to realize reduce context from fields” service=kapacitor task\_master=main task=testing node=influxdb\_out8 err=“field “free\_storage\_space\_minimum” missing from point”

The script looks like that:

```
dbrp "telegraf"."autogen"

var db = 'telegraf'

var rp = 'autogen'

var measurement = 'cloudwatch_aws_es'

var groupBy = []

var whereFilter = lambda: ("domain_name" == 'backend01-dev')

var period = 1m

var every = 30s

var name = 'testing'

var idVar = name

var message = 'DEV {{.Level}}: {{.ID}} {{ index .Fields "value" }}'

var idTag = 'alertID'

var levelTag = 'level'

var messageField = 'message'

var durationField = 'duration'

var outputDB = 'chronograf'

var outputRP = 'autogen'

var outputMeasurement = 'alerts'

var triggerType = 'threshold'

var details = 'Please take action ASAP'

var crit = 10.0

var warn = 20.0

// var info = 30.0
var info = 50.0

var data = stream
    |from()
        .database(db)
        .retentionPolicy(rp)
        .measurement(measurement)
        .groupBy(groupBy)
        .where(whereFilter)
    |window()
        .period(period)
        .every(every)
        .align()
    |min('free_storage_space_minimum')
        .as('free_value')
    |min('total_volume_size')
        .as('disk_value')

// var percentage = eval(lambda: float("free_value")/float("disk_value") * 100.0)

var trigger = data
    |eval(lambda: "free_value"/"disk_value" * 100)
        .as('percentage')
    |alert()
        .info(lambda: float('percentage') < info)
        .warn(lambda: float('percentage') < warn)
        .crit(lambda: float('percentage') < crit)
        .message(message)
        .id(idVar)
        .idTag(idTag)
        .levelTag(levelTag)
        .messageField(messageField)
        .durationField(durationField)
        .details(details)
        .stateChangesOnly()
        .opsGenie2()

trigger
    |eval(lambda: float('percentage'))
        .as('value')
        .keep()
    |influxDBOut()
        .create()
        .database(outputDB)
        .retentionPolicy(outputRP)
        .measurement(outputMeasurement)
        .tag('alertName', name)
        .tag('triggerType', triggerType)

trigger
    |httpOut('output')

```

Can anyone help me to understand where the problem is? It seems like it missing starting point, however there is a period and every defined.

Also, is there a way to actually output your “values” to the watch script? It will be very helpful in future debugging.

---

<div class="post-metadata">

**Author:** ![Heath\_Raftery](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/heath_raftery/32/1678_2.png) [@Heath\_Raftery](https://community.influxdata.com/u/Heath_Raftery)\
**Post date:** [August 23, 2018, 11:38am UTC](https://community.influxdata.com/t/tickscript-doesnt-seems-to-be-running-correctly/6312/2 "2018-08-23T11:38:35Z")

</div>

I would hazard a guess that the field `free_storage_space_minimum` is missing from point, based on the error message you quote. Are you sure that your points have that as a field?

I not sure what you mean by “values” and “watch script” but perhaps you could have a look at the `log()` node: [LogNode | Kapacitor 1.5 Documentation](https://docs.influxdata.com/kapacitor/v1.5/nodes/log_node/)

By the way, note that you can use the “preformatted text” button in the editor (looks like `</>` ) on this website to help format your script text. Makes it a lot easier for people to read.
