Bacula/Dir Config/scripts/webhooks/mextract.py

9 lines
233 B
Python

import re
def mextract(report, variable):
try:
result = re.search(variable + '(.*)\n', report)
return(result.group(1).lstrip()) # lstrip removes leading spaces.
except:
return("[Variable Not found]")