obj = None
pyCmd = 'obj = formatJson["Header1"]["SubHeader1"]["Field1"]; print(obj)'
exec( pyCmd, {}, locals() )
print( '[2] obj : %s' % obj)
def executeRule(stdout, rule):
obj = None
try:
formatJson= json.loads(stdout)
pyCmd = 'obj = formatJson["Header1"]["SubHeader1"]["Field1"]'
#pyCmd = 'obj = formatJson' + rule
print( 'py-cmd: "%s"' % pyCmd)
eval( pyCmd, {}, locals() )
print( '[1]obj : %s' % obj)
except BaseException as e:
print( e, file=sys.stderr)
print( '[2]obj : %s' % obj)
return obj