Forum Discussion

Hoang_Hung's avatar
Jul 14, 2022
Solved

Monitor Layer 7

Dear all I have a backend use web service port 8010. After I have using monitoring layer 7 but it not working. I have tried curl-v https://abc:8010/swagger/index.html Response:  > GET /swagger/in...
  • StephanManthey's avatar
    StephanManthey
    Jul 15, 2022

    Please try a Send-string of (and make sure to replace the hostname of abc with the hostname you were actually using in your cURL request):

    GET /swagger/index.html HTTP/1.1\r\nHost: abc:8010\r\nUser-Agent: curl/7.79.1\r\nAccept: */*\r\n\r\n

    ... and a Receive-string of (accepting status codes of 200 or 301 or 301). This string is handled as a non case-sensitive regular expression:

    ^HTTP/1\.[01]\s+(200|301|302)

     It will look for a response using HTTP/1.0 or HTTP/1.1 followed by at least one whitespace character (\s+) followed by one of the acceptable status code.

    If you are absolutely sure there will be a HTTP/1.1 200 OK in the response, you can put it in as well. The dot (.) in "HTTP/1.1" is handled as a wildcard (it is still treated as a regexp), but this shouldn´t matter.

    Keep in mind, that some webservers don´t reply with a reason phrase (here it is the OK; might be MOVED PERMANENTLY, FOUND etc.). That´s why it is now best practice not to include it in your receive string.