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: GET /rest/apigateway/health/all HTTP/1.1\r\nHost: rldimedas1.tcbna.net\r\nConnection: Close\r\n\r\n User name and password required: DEVF5Inside / <password> Expected return to be parsed: { "status": "green", "elasticsearch": { "cluster_name": "DEV_EventDataStore", "status": "green", "number_of_nodes": "2", "number_of_data_nodes": "2", "timed_out": "false", "active_shards": "388", "initializing_shards": "0", "unassigned_shards": "0", "task_max_waiting_in_queue_millis": "0", "port_9240": "ok", "response_time_ms": "16" }, "is": { "status": "green", "diskspace": { "status": "up", "free": "99419619328", "inuse": "152539549696", "threshold": "25195916902", "total": "251959169024" }, "memory": { "status": "up", "freemem": "2668806528", "maxmem": "3817865216", "threshold": "368102604", "totalmem": "3681026048" }, "servicethread": { "status": "up", "avail": "286", "inuse": "14", "max": "300", "threshold": "30" }, "response_time_ms": "103" }, "terracotta": { "status": "green", "nodes": "2", "healthy_nodes": "2", "response_time_ms": "67" } } 3 Key Indicators of healthy Services: #1 "elasticsearch": { "cluster_name": "DEV_EventDataStore", "status": "green", #2 "is": { "status": "green", #3 "terracotta": { "status": "green", I would think it was possible to craft the received string parse to check for all 2 key indicators so I do not have to create 3 separate health checks. I have tried just checking for the first indication by following suggestion in DevCentral but is did not work: \"elasticsearch\": \{\"cluster_name\": \"DEV_EventDataStore\",\"status\": \"green\", This solution is complicated by all 3 indicators being the same syntax: "status": "green" I think there might be an issue with my GET string as well because the Monitor log only shows "200 OK" as the response from the server. When I change the receive string to only elasticsearch, it passes. Any Help Here?756Views0likes4Comments