Forum Discussion
BenConrad_10265
May 27, 2011Nimbostratus
Can a custom HTTP monitor work with a JSON response?
Hi,
My Devs have created a health check page on our Tst web servers that returns a JSON response.
HTTP/1.1 200 OK (application/json)
So, a couple of questions/comments:
1) Can I use a LTM monitor to inspect the contents of a JSON response? So far, I've had no luck getting this to work. I can successfully monitor static pages on the same servers so I know I've got things setup properly.
2) I noticed that If I hit our URL with WGET I can see the contents of the JSON file in Wireshark. If I hit the URL with Internet Explorer or Firefox they both pop up a "download" window and I see binary data in Wireshark.
Any thoughts?
Ben
- hooleylistCirrostratusHi Ben,
- hwidjaja_37598AltostratusCan you try to change the content type from "application/json" to "text/html"?
- Goharon_33284NimbostratusI'm a new member, so I'm just looking around.
- BenConrad_10265NimbostratusThanks Aaron and Hum. It seems that it should be possible to change the response to "text/html", I've asked our Devs to look into this. Currently, in order to inspect the results of the JSON repsonse I have to download the file (Firefox/IE) or use wget which dowloads automatically. Worst case I'll have to look at the bits as Aaron suggested. Ben
- hwidjaja_37598AltostratusAs an alternative, you might want to use curl command also ... curl can show the contents directly to standard output
- BenConrad_10265NimbostratusHi Aaron,
- PSPKNimbostratus
How did you take the tcpdump
Appreciate if you can provide the command here
- BenConrad_10265NimbostratusI got this working using \x74\x72\x75\x65. The reason it was not working is because our Active LTM was all screwed up and needed a reboot, the LTM it was not syncing the configs from the GUI to the internals. Why? That is for us to find out another day... :-)
- hooleylistCirrostratusHi Ben,
- Colin_StubbsNimbostratus
For anyone reading this post! There's better ways to do this now.
JSON.sh is available now to do this in pure shell, https://github.com/dominictarr/JSON.sh
I've written up an example using JSON.sh as the basis; which should be able to handle most JSON responses generically.
http://blog.routedlogic.net/?p=555
Recent Discussions
Related Content
Â
DevCentral Quicklinks
* 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
Discover DevCentral Connects