Forum Discussion
Richard_Grigsb1
Mar 03, 2021Altostratus
Stumped by regular expression
Requirement: build a health Check to send an api url call to server and parse the return value for key indicators. URL: rldimedas1.tcbna.net/rest/apigateway/health/all Crafted Send String...
JRahm
Mar 03, 2021Admin
Could you use an external monitor so you can parse the json return data more cleanly than with REGEX? in python, that would be pretty simple:
from sys import stdout
resp = '''your json response string'''
if resp['elasticsearch']['status'] == 'green' and resp['is']['status'] == 'green' and resp['terracotta']['status'] == 'green':
stdout.write('UP')
else:
stdout.write('DOWN')
UP
You can find a full python external monitor sample here in the codeshare for RADIUS that you could modify to meet your needs.
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects