The normalize_value () function converts a string to either an integer or boolean value. If value cannot be cast to an integer the function tries to convert the string to boolean.
normValue = normalize_value( value )
|
value |
String |
Value to be converted to integer or boolean. |
|
Integer or Boolean |
Converted value . |
|
ValueError |
The specified value could not be converted to an integer or boolean value. |
from splunk.appserver.mrsparkle.lib import util
intVal = util.normalize_value('42')
boolVal = util.normalize_value('false')