Ad Widget

Collapse

Calculated item from log.count

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • doogie
    Junior Member
    • May 2020
    • 15

    #1

    Calculated item from log.count

    So I have a simple log.count which is updating every second, as follows:

    log.count[/var/log/kamailio/kamailio.log,dropping,,,skip,]

    I want to create a calculated item from this with the sum of the last minute, but I'm having fun with trying to get the quotes in the right place - and I can't get it working.

    Tried:

    sum("log.count[/var/log/kamailio/kamailio.log,dropping,,,skip,]",60) : Cannot evaluate expression: "Cannot evaluate function "sum(60)": invalid value type.".
    sum(log.count"[/var/log/kamailio/kamailio.log,dropping,,,skip,]",60) : Cannot evaluate function "sum(dropping,,,skip,]",60)": item "aio-sensu-dev.2600hz.net:log.count"[/var/log/kamailio/kamailio.log" does not exist.
    sum(log.count["/var/log/kamailio/kamailio.log,dropping,,,skip,"],60) : Incorrect function 'sum' expression. Check expression part starting from: "],60)
    sum(log.count"["/var/log/kamailio/kamailio.log,dropping,,,skip,"]",60) Cannot evaluate function "sum(dropping,,,skip,"]",60)": item "aio-sensu-dev.2600hz.net:log.count"["/var/log/kamailio/kamailio.log" does not exist.

    How do I make this work?

    Doogie
  • doogie
    Junior Member
    • May 2020
    • 15

    #2
    As community support is lacking on this issue - I managed to finally work it out (I know I should pay for support, but I'm trying the product first!!!).

    Two issues:

    1) Quotes are VERY important, and getting them in the right spot is crucial
    2) Data type is also VERY crucial

    So 2 was an eureka moment (or what a n00b you are...)

    If you are using log.count - make sure the 'Type of Information' is 'Numeric (unsigned)' not log. If it's log it can't do a SUM of the values as they're not numeric.

    sum("log.count[/var/log/kamailio/kamailio.log,dropping,,,skip,]",60)

    Is correct, but make sure your value is also correct!

    Comment

    Working...