Forum Discussion

fgf_165674's avatar
fgf_165674
Icon for Nimbostratus rankNimbostratus
Nov 23, 2015

Carriage Return, HTTP Monitor

Hi,

 

using a HTTP monitor, if I use "\r\n" to get a carriage return, it doesn't work.

 

For example,

 

telnet :80 "GET /hello HTTP/1.0" (manual carriage return) -> it works fine, returns a "200 OK"

 

"GET /hello HTTP/1.0\r\n" -> it doesn't work, returns a code different of 200

 

I made a packet capture, and in the first case (manual carriage return), I can see that the load balancer sends the characters "0x0d 0x0a" representing the carriage return. In the second case ("\r\n"), the load balancer sends these characters (114,110) and it doesn't appear a new line.

 

Do you know how it is possible to send a carriage return from the monitor configuration?

 

THanks. Regards,

 

  • Don't put your whole string in quotes. Your send string should just be

    GET /hello HTTP/1.0\r\n
    with no quotes.

    • Brad_Parker_139's avatar
      Brad_Parker_139
      Icon for Nacreous rankNacreous
      Also, if you're not using auth, you should have a double \r\n. https://support.f5.com/kb/en-us/solutions/public/2000/100/sol2167.html
  • Don't put your whole string in quotes. Your send string should just be

    GET /hello HTTP/1.0\r\n
    with no quotes.

    • Brad_Parker's avatar
      Brad_Parker
      Icon for Cirrus rankCirrus
      Also, if you're not using auth, you should have a double \r\n. https://support.f5.com/kb/en-us/solutions/public/2000/100/sol2167.html
  • Hi Brad,

     

    I am not using quotes, I have only used them in this example.

     

    In the SOL2167, it says that \r will be displayed as 0x0d in tcpdump traces. I have made a packet capture and it is not true, I see 0x5c 0x72 0x5c 0x6e for the characters \r\n

     

    Regards,

     

  • eneR's avatar
    eneR
    Icon for Cirrostratus rankCirrostratus

    Try to escape the \ with another \ --> \r\n

     

  • this is mine. i am running 12.0.

     monitor
    
    root@(ve11c)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm monitor http myhttp
    ltm monitor http myhttp {
        adaptive disabled
        defaults-from http
        destination *:*
        interval 5
        ip-dscp 0
        send "GET /hello HTTP/1.0\r\n"
        time-until-up 0
        timeout 16
    }
    
     tcpdump
    
    22:47:05.688948 IP 200.200.200.13.56097 > 200.200.200.101.80: Flags [P.], seq 1:24, ack 1, win 115, options [nop,                            nop,TS val 634924596 ecr 491153398], length 23 out slot1/tmm1 lis=
            0x0000:  0ffe 0800 4500 004b 5167 4000 4006 c741  ....E..KQg@.@..A
            0x0010:  c8c8 c80d c8c8 c865 db21 0050 0613 9444  .......e.!.P...D
            0x0020:  e711 c209 8018 0073 2242 0000 0101 080a  .......s"B......
            0x0030:  25d8 2e34 1d46 67f6 4745 5420 2f68 656c  %..4.Fg.GET./hel
            0x0040:  6c6f 2048 5454 502f 312e 300d 0a0d 0a01  lo.HTTP/1.0.....
            0x0050:  0501 0000 0100                           ......