JSON input filter for value

(Sjaak) #1


I've wrote this script to parse with a metric visualization but it doesn't work. I've tried reading the docs but couldn't find how to match values.

{ "script" : "doc['int_wan'].value = wan1" }

(CJ Cenizal) #2

Here's how you can compare against the field's value and return different values based on how the condition is evaluated:

{ "script" : "if (_value < 300) { return 200; } return 400" }

(Sjaak) #3

I don't want to return a different value though, I want to match field values.

E.g. I have a metric with 4 different sums, each summing the total of bytes. What I want to do is use the JSON input to filter the same based on the interface. WAN1, WAN2, etc.

(system) #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.