F5Networks / f5-appsvcs-extension

F5 BIG-IP Application Services 3 Extension
Apache License 2.0
169 stars 54 forks source link

Unable to add double quotes to HTTPS monitor receive string #773

Closed pedley-f5 closed 9 months ago

pedley-f5 commented 1 year ago

Environment

Summary

Unable to add double quotes into monitor

Steps To Reproduce

Steps to reproduce the behavior: I have this declaration for a monitor: "check_monitor": { "class": "Monitor", "monitorType": "https" "interval": 5, "timeout": 16, "send": "GET /site/health HTTP/1.1\r\nHost: myhost.example.com\r\nConnection: Close: \r\n\r\n", "receive": "\"status\":\"UP\"", "clientTLS": {"bigip": "/Common/Shared/mysslprofile"} },

I am trying to set receive string to: "status": "UP"

If I try to single escape the quotes, I get: status: UP If I try to double-escape the quotes, I get a 500 error from app svcs.

How do I properly escape the quotes in my declaration so I can have them appear in my monitor?

RobCupples commented 1 year ago

By the way I notice you are missing a comma after "monitorType": "https".

This example below seems to accomplish what you are looking for.

{
  "class": "ADC",
  "schemaVersion": "3.37.0",
  "controls": {
    "class": "Controls",
    "trace": true,
    "logLevel": "debug",
    "traceResponse": true
  },
  "Tenant": {
    "class": "Tenant",
    "Application": {
      "class": "Application",
      "check_monitor": {
        "class": "Monitor",
        "monitorType": "https",
        "interval": 5,
        "timeout": 16,
        "clientTLS": {
          "bigip": "/Common/serverssl"
        },
        "send": "GET /site/health HTTP/1.1\r\nHost: myhost.example.com\r\nConnection: Close: \r\n\r\n",
        "receive": "\\\"status\\\": \\\"UP\\\""
      }
    }
  }
}
pedley-f5 commented 1 year ago

The triple-escape worked, thank you!

dstokesf5 commented 10 months ago

@pedley-f5 While it is not ideal, if we change the current escaping behavior now, we are likely to break some user's configurations. Is the current behavior and workaround proposed by @RobCupples acceptable for you?

pedley-f5 commented 10 months ago

Yes! Actually we deployed that workaround awhile ago and are in good shape.

On Thu, Jan 11, 2024, 15:27 Daniel Stokes @.***> wrote:

@pedley-f5 https://github.com/pedley-f5 While it is not ideal, if we change the current escaping behavior now, we are likely to break some user's configurations. Is the current behavior and workaround proposed by @RobCupples https://github.com/RobCupples acceptable for you?

— Reply to this email directly, view it on GitHub https://github.com/F5Networks/f5-appsvcs-extension/issues/773#issuecomment-1888068859, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKCJLUB45GQZSWBLNGCLBBDYOBRNRAVCNFSM6AAAAAA6V6FZ66VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBYGA3DQOBVHE . You are receiving this because you were mentioned.Message ID: @.***>