This product is no longer sold. We no longer update these help pages, so some information may be out of date.
HTTP POST
HTTP POST is a simple way to forward your log messages to Log Management (InsightOps).
This may be more preferable then other input methods in environments where no Log Management (InsightOps) integrations exist. HTTP POST relies on a User supplying a Token in the same way that Token TCP forwarding method does. Create a log to send your data to Log in to Log Management (InsightOps) and click the “Add Data” button in the top navigation.
Click the “Webhook” icon
Give your log a name and select an existing Log set or create a new one
This will display a URL that you will use to send your log data to. The last part of the URL is the log token, which identifies the log that the data should be sent to.
If your Log Management (InsightOps) account is in our European data center, then the URL will start with eu.
Sample URL:
https://us.webhook.logs.insight.rapid7.com/v1/noformat/abc123-abc2-xyz1-abc-1234567890
Now your log is created, you can send data to it. Here is a sample cURL command:
curl -i -H "Accept: application/json" -X POST -d '{"message":"sending logs to Log Management (InsightOps)", "success":true}' https://us.webhook.logs.insight.rapid7.com/v1/noformat/abc123-abc2-xyz1-abc-1234567890
Send data to your log You will see this output in your terminal window
HTTP/1.1 204 No Content
Cache-Control: no-cache, no-store, must-revalidate
Content-Length: 0
Date: Fri, 23 Feb 2018 12:08:53 GMT
Expires: 0
Pragma: no-cache
Connection: keep-alive
Using Python:
import requests
data = { "msg": "My Log Message"}
req = request.post("https://us.webhook.logs.insight.rapid7.com/noformat/logs/abc123-abc2-xyz1-abc-1234567890", data=data)
Here is an example of sending data to the Webhook using JQuery:
function sendLogData(logMessage)
{
// strip line feeds or they'll appear as individual entries
logMessage = logMessage.replace(/\n/g, "");
var OpsWebhookURL = "https://us.webhook.logs.insight.rapid7.com/v1/noformat/abc123-abc2-xyz1-abc-1234567890";
$.ajax({
type: "POST",
url: OpsWebhookURL,
data: logMessage,
dataType: "text/json",
processData: false
});
}
//send some data
sendLogData('This is an unformatted log entry');
sendLogData('{"message" : "this is a JSON Message"}');