Hey! I am actually working on that too. I don't have it JSON yet. Gonna work with a co-worker later on to do that but below is what I have that writes it to a file and parsed with a python library called ciscoconfparse. Documentation is in the comments. Hope this helps! I will reply later on when I get in JSON.
#!/usr/bin/env python3
from f5.bigip import ManagementRoot
import sys
from ciscoconfparse import CiscoConfParse
#https://devcentral.f5.com/s/question/0D51T00006i7jW8SAI/python-show-runningconfig
#https://f5-sdk.readthedocs.io/en/latest/ F5 SDK documentation
#https://pypi.org/project/ciscoconfparse/ ciscoconfparse documentation
mgmt = ManagementRoot('IP', 'USERNAME', 'PASSWORD')
x = mgmt.tm.util.bash.exec_cmd('run', utilCmdArgs='-c "tmsh running-config"')
output = x.commandResult
with open('output.conf', 'w') as f:
print(output, file=f)
parse = CiscoConfParse('pathtofile/output.conf', syntax='junos', comment='#')
for intf_obj in parse.find_objects('auth ldap system-auth'):
samaccount = intf_obj.re_match_iter_typed('\s+login-attribute\s(.*)', default="")
print(samaccount)
if samaccount == 'samaccountname':
print("Woohoo")