jay_41157
Sep 16, 2008Nimbostratus
reg exp in health monitor
Hi ,
I need my recieve string to be exactly 0
So I am thinking to use: "^0\n"
Will this work? any other ideas?
Thanks
Here is an example of hex with 0's. 2 in ascii =32 in hex, 0 in ascii =30 in hex, 0 in ascii =30 in hex
line number hex ascii
0x0130 3d3d 3d3d 0d0a 3230 3020 2d20 4f6b 6179 ====..200.-.Okay
The carriage return and line feed should show up as dots in the ascii and 0d 0a in hex.
If you expect the server to only send 0 in the response body, it should be 30 0d 0a in hex. It looks like the server is actually sending nulls, and then random characters: E(@@x, etc. Is this encrypted? Or is it some proprietary protocol over HTTP?
Here is what a test response from TCP::respond content "0\r\n\r\n" looks like:
18:15:04.351359 802.1Q vlan4094 P0 10.41.135.20.81 > 172.31.42.18.3891: P 1:6(5) ack 155 win 3711 (DF)
0x0000 0ffe 0800 4500 002d fce7 4000 ff06 1774 ....E..-..@....t
0x0010 0a29 8714 ac1f 2a12 0051 0f33 57c6 a3e3 .)....*..Q.3W...
0x0020 2daf b11d 5018 0e7f 0bc5 0000 300d 0a0d -...P.......0...
0x0030 0a .
The last five characters are 0 (30), carriage return (0d), line feed (0a), carriage return (0d), line feed (0a). Of course, I'd expect an HTTP server to respond with HTTP headers. If your application does, then these would be considered in the regex receive string match. So you'd actually want to specify something like:
0\r\n\r\n$
or perhaps:
.*0\r\n\r\n$
Aaron