Created
April 13, 2013 03:50
-
-
Save jadell/5376837 to your computer and use it in GitHub Desktop.
Ajax query of Loggly from jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax("https://mydomain.loggly.com/api/facets/date/?q=my_search_criteria", { | |
// Don't send the _=timestamp query parameter | |
cache: true, | |
// Send HTTP auth credentials | |
username: api_readonly_username, | |
password: api_readonly_password, | |
// Use JSONP | |
dataType: "jsonp" | |
}).done(function(data) { | |
// handle data, probably a call to some graphing library | |
}).fail(function() { | |
// alert failure | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment