Sending Events via the APIs
Events can be sent into Loggly via syslog or HTTP POSTs. If you need to configure your servers to send Loggly data via a syslog based service, please refer to the Logging Configuration page.
To send in events via the APIs, through HTTP POSTs, you'll use the hostname logs.loggly.com (instead of the [subdomain].loggly.com format used by the other API calls). The APIs on the proxy cluster support both HTTP and HTTPs, and use a SHA-2 key in the URL for validation. These keys can be generated by creating an HTTP input type from the Input Management page on your Loggly account. Here's an example input URL:
http://logs.loggly.com/inputs/83e527d7-fad3-4d93-89da-0c2d8c0bcd6c
If your servers are located on AWS US-East-1, you can use the host ec2.logs.loggly.com to send logs to us without incurring transfer charges. We'll be adding deployments in other regions soon.
To create an HTTP input, login to your account, then navigate to the inputs tab. Click on the add input button at the bottom of the page and then provide an input name and description for the input:
Once you create an HTTP input, you'll be taken to the input detail page, which will contain the URL you can use to send data to that particular input. If you need to rotate the SHA-2 key associated to a particular input, you can click on the generate new URL button at the bottom of the input detail page.
Testing
You can test the newly created input by sending in some test POST data via curl:
curl -d "127.0.0.1 - there's no place like home" http://logs.loggly.com/inputs/83e527d7-fad3-4d93-89da-0c2d8c0bcd6c
Keep in mind that the SHA-2 key above is an example, and you'll need your own key in there for it to work!
If you don't have curl, you can use wget instead:
wget --quiet -O - --post-data "127.0.0.1 - there's no place like home" http://logs.loggly.com/inputs/83e527d7-fad3-4d93-89da-0c2d8c0bcd6c
The JSON result from a POST to an input contains a response and timestamp:
{ 'response': 'ok' }
Encoding
If you are sending us events via HTTP, you should encode your POST data. If we see a header with 'application/x-www-form-urlencoded' as the content-type, we'll unencode it before storing it in your account.
Note: Some tools or libraries may add the urlencoded header even though they may not actually encode the POST data. If you don't encode your POST data, but the headers are set, you may see '+' signs in your events converted to spaces.
