|
@@ -7,6 +7,7 @@
|
|
import sys
|
|
import sys
|
|
import ldap
|
|
import ldap
|
|
import json
|
|
import json
|
|
|
|
+import re
|
|
|
|
|
|
def print_list(the_list):
|
|
def print_list(the_list):
|
|
for each_item in the_list:
|
|
for each_item in the_list:
|
|
@@ -31,6 +32,8 @@ def print_list(the_list):
|
|
keytxtresult = (' '.join(keyresult).replace('cn=Monitor', '').replace('cn=', '').strip())
|
|
keytxtresult = (' '.join(keyresult).replace('cn=Monitor', '').replace('cn=', '').strip())
|
|
# join the values into a string
|
|
# join the values into a string
|
|
valueresult = ' '.join(str(e) for e in v)
|
|
valueresult = ' '.join(str(e) for e in v)
|
|
|
|
+ # sanitize the timestamps if they are present
|
|
|
|
+ valueresult = re.sub('(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})([Z])$', r'\3-\2-\1 \4:\5:\6', valueresult)
|
|
# usecases of formatting data differently
|
|
# usecases of formatting data differently
|
|
if "BackGroundProc" in keytxtresult:
|
|
if "BackGroundProc" in keytxtresult:
|
|
resultArray.append("- ")
|
|
resultArray.append("- ")
|