I'm monitoring a log file to capture a number from it.
Basically, the line that I'm looking for is something like this:
I've created a log item and filtered it using a simple regular expression.
There is a preprocessing step using Javascript.
Still, the item gets unsupported with the error message bellow
As I understand it, the script should return an integer.
I'm not sure why it is returning a string, though.
Any thoughts?
Basically, the line that I'm looking for is something like this:
took 0 min(s) 29 sec(s) to sync after boot up
Code:
log["/tmp/mnt/entware/entware/var/log/messages","took (.*) to sync after boot up",,,skip,\1]
Code:
var MIN = parseInt(value.match(/(\d+) min\(s\)/)); var SEC = parseInt(value.match(/(\d+) sec\(s\)/)); var TIME = (MIN * 60) + SEC; return TIME;
Value "NaN" of type "string" is not suitable for value type "Numeric (unsigned)"
I'm not sure why it is returning a string, though.
Any thoughts?