The ingestion API allows users to send logs to Unomaly through HTTP requests.

How to use the ingestion API

Call the batch endpoint to send multiple logs at the same time, in order to avoid latency:

http://my-instance/v1/batch

The API call expects a JSON payload of this type:

Property Required Description
Message yes The log message that Unomaly will analyze.
Source yes Where the log originates, shown as ‘system’ in Unomaly.
Metadata no Any JSON payload that will be displayed in the situations UI.
Timestamp no Timestamp of the original log. If there is no timestamp, Unomaly will use the current time.

The batch endpoint expects an array of events such as:

cat <<EOF | curl -i -k -H "Content-Type: application/json" -X POST -d @- https://{unomaly}/v1/batch
[ {
    "message": "app[123] error: failed to parse object",
    "timestamp": "2018-09-26T12:49:35+0000",
    "source": "systemx",
    "metadata": {
   	 "tag": "test"
    }
} ]
EOF

Response codes

Both API will reply with a 200 status if the ingestion was successful. They will respond with a 400 error message if there were errors receiving and decoding the payload.

A response from Unomaly may be:

HTTP/1.1 200 OK
Date: Wed, 26 Sep 2018 12:49:34 GMT
Server: fasthttp
Content-Length: 0

example