The eval node replaces all fields with the computed fields unless the 
`keep` property is used. Simply add `.keep()` or `.keep('val', 'value')` to 
the eval node to tell it to keep those specific fields.

On Friday, October 28, 2016 at 12:22:36 AM UTC-6, 
vipul....@traveltriangle.com wrote:
>
> hi all
> I have written the following tick script 
>
>
> stream
>     |from()
>         .database('tech')
>         .retentionPolicy('autogen')
>         .measurement('passenger_queue')
>     |log()
>     |eval(
>         lambda: if("host" == '172.30.2.198','true','false')
>     )
>         .as('val')
>     |alert()
>     .id('kapacitor passenger_queues alert')
>        .message('{{ .Level }} {{ .ID }} /{{ index .Tags "host" }} has a 
>  queue length :{{ index .Fields "value" }}')
>        .info(lambda: "value" > 50)
>        .warn(lambda: "value" > 70)
>        .crit(lambda: "value" > 80)
>        .stateChangesOnly()
>        .email()
>     |log()
>
>
>
>
> on enbaling the script I get the following results in kapacitor show I GET 
> THE FOLLOWING RESULT :
>
>
>
> DOT:
> digraph pass_alert {
> graph [throughput="0.00 points/s"];
>
> stream0 [avg_exec_time_ns="0" ];
> stream0 -> from1 [processed="160"];
>
> from1 [avg_exec_time_ns="2.856µs" ];
> from1 -> log2 [processed="160"];
>
> log2 [avg_exec_time_ns="0" ];
> log2 -> eval3 [processed="160"];
>
> eval3 [avg_exec_time_ns="550.728µs" eval_errors="0" ];
> eval3 -> alert4 [processed="160"];
>
> alert4 [alerts_triggered="0" avg_exec_time_ns="101.577µs" 
> crits_triggered="0" infos_triggered="0" oks_triggered="0" 
> warns_triggered="0" ];
> alert4 -> log5 [processed="0"];
>
> log5 [avg_exec_time_ns="0" ];
> }
>
> THE PROBLEM IS THAT alerts_triggered are coming 0 while avg exec time is 
> non zero
> as soon I as I remove the eval statement aleerts triggered start coming 
>

-- 
Remember to include the version number!
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxData" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
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/859c3ebe-f77a-4ffe-8d1a-4ee7280a697a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to