Ingesting with Raw HEC

LogScale's Raw HEC API is a simple line-delimited ingest endpoint for unstructured logs.

You will find it at /api/v1/ingest/hec/raw and at /services/collector/raw.

Simply send a POST to one of the two endpoints above. Each line in the input (separated by /n, /r, or /r/n) will be ingested as an event.

You can optionally add an X-Splunk-Request-Channel header or channel as a query parameter. These will be added as a field on the event named "channel".

Example

Note that you can send data without wrapping it in JSON, for example:

Show:
shell
curl -v -X POST $YOUR_LOGSCALE_URL/api/v1/ingest/hec/raw?channel=foo \
    -H "Authorization: Bearer $INGEST_TOKEN" \
    -H "Content-Type: text/plain" \
    -d '2024-10-14 12:01:21 INFO: Application started.'

Multiple log lines are also supported, as shown in the following example:

Show:
shell
curl -v -X POST $YOUR_LOGSCALE_URL/api/v1/ingest/hec/raw?channel=foo \
    -H "Authorization: Bearer $INGEST_TOKEN" \
    -H "Content-Type: text/plain" \
    -d @- << EOF
2024-10-18 06:51:33 [Helper Tool] Info CD063E71-9F0A-4861-99A8-28204DE1234: Helper Tool Initialized.
2024-10-18 06:51:33 [Helper Tool] Info CD063E71-9F0A-4861-99A8-28204DE1234: New Connection requested from pid: 33184
EOF

This creates two unique events in LogScale.