Forum Discussion

Chris1's avatar
Chris1
Icon for Neophyte rankNeophyte
4 months ago

Complex datapoint expression syntax

I'm trying to add a complex datapoint on the AWS_ECS_ContainerInsights LogicModule but am getting an error stating that the expression is incorrect.  The UI gives no reason why and I've double checked all the brackets, am I missing something here?

if(
    or(un(CPUUtilized), un(CPUReserved), un(MemoryUtilized), un(NetworkTxBytes), un(NetworkRxBytes)), 
    0, 
    if(
        and(
            lt((CPUUtilized / CPUReserved) * 100, 0.01),
            lt(MemoryUtilized, 0.1),
            lt(NetworkTxBytes, 0.1),
            lt(NetworkRxBytes, 0.1)
        ),
        1,
        0
    )
)

 

  • I didn't test it but the documentations says that or() and and() only take two expressions. You likely need to nest them like or(or(or(or(...etc

  • I didn't test it but the documentations says that or() and and() only take two expressions. You likely need to nest them like or(or(or(or(...etc