Logentries Docs

Find comprehensive guides and documentation to help you start and continue to work with Logentries.

    

Search results for "{{ search.query }}"

No results found for "{{search.query}}".
View All Results

HTTP POST

In addition to Logentries integrations, you may also submit your logs to Logentries via our REST API.

In order to get started with our REST API, you will need to create a new log by clicking on the Add New Log menu in the top-left corner of your Logentries dashboard.

Next, select the Manual option from the Add a Log screen.

Then, fill out the Log Name and Log Set fields, and other settings as needed (If unsure, leave all other settings at their default settings). Then click the Create Log Token button. Once you click the button, your Log Token will be displayed at the bottom of the screen.

Now that you have your log token, you are ready to connect to our REST API.

Endpoint

Once you have generated your Log Token, you will use it to make HTTP POST calls to
https://webhook.logentries.com/noformat/logs/LOG-TOKEN where LOG-TOKEN is the Log Token you just generated.

You must include the header "Content-Type: application/json" in all your POST requests.

When using our REST API to send logs, the maximum number of characters that can be included in the body is 8192. If you exceed this limit, your message will be dropped and will not be placed into your log.

After successfully sending a request to our REST API, you should receive a 204 No Content status code and an empty body response back from our server.

Code Examples

Python

The following is a simple Python example of sending a POST request to this endpoint.

import requests
data = { "msg": "My Log Message"}
req = request.post("https://webhook.logentries.com/noformat/logs/2072e0bd-9812-4625-a01c-1c955d14e16c", data=data)

Curl

The following is an example of sending a POST request via Curl.

curl -H "Content-Type: application/json" -X POST -d '{"username":"foo","email":"bar@foo.com"}' http://webhook.logentries.com/noformat/logs/5b26ee19-7439-4740-9d79-3fd6b4b94618

HTTP POST