Forum Discussion
F5 Health Monitor Receive String as JSON
Hello,
We have to set up Health Monitor where the received string in response header is in json format.
And therefore, I am wondering, how to configure the proper string that F5 will understand:
Received String:
{"status":"started","services":[{"name":"nae-kmip","status":"started"}]}
It seems to except RegEx like the following:
HTTP/1.1 200 OK|name:name-kmip,status:started
However, I am not sure if this would match.
I would appreciate any advise.
Thanks,
- zamroni777Nacreous
{}()[], are special characters in regex syntax.
use hex code to write such characters, such as \x7B for "{", \x2C for "," etc.
- Kay_Altostratus
try
\"status\":\"started\",
- NetmartNimbostratus
Thank you Kay.
First we have to fix the send string.
We tested the send string with OpenSSL and we received 200 ok
echo -e "GET /api/v1/system/services/status?service_names=nae-kmip HTTP/1.1\r\nHost: 10...***.\r\nConnection: Close\r\n\r\n";sleep 1) | openssl s_client -connect 10...***.:443
--
HTTP/1.1 200 OK
Date: Mon, 11 Nov 2024 18:24:32 GMT
Content-Type: application/json; charset=UTF-8:
{"status":"started","services":[{"name":"nae-kmip","status":"started"}]}
However, adding this string into F5 Health Monitor Send Field:
GET /api/v1/system/services/status?service_names=nae-kmip HTTP/1.1\r\nConnection: Close\r\n\r\
We receive 400 [Bad Request].
So what is the difference running from the box/Linux CMD with OpenSSL and running from F5 Application?
Is there setting in F5 we are missing?
Please advise.
Thanks.
- Kay_Altostratus
HTTP/1.1 always needs the Host header
try:
GET /api/v1/system/services/status?service_names=nae-kmip HTTP/1.1\r\nHost: xyz.example.com\r\nConnection: Close\r\n
or try HTTP/1.0
Recent Discussions
Related Content
* 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