Messages: insert
Description
Inserts messages.
- Entity name, source, type, severity, and tag names must not contain non-printable characters. These fields are converted to lower case when stored.
- Message text and message tag values are case-sensitive and are stored as submitted.
- Field values are trimmed of leading and trailing non-printable characters including tab, line feed, and space.
- Message text or at least one tag is required, otherwise the message is dropped silently.
- The number of message tags in a single message must not exceed 1,024.
Date limits:
- Minimum time that can be stored in the database is 1970-01-01T00:00:00.000Z, or
0milliseconds from Unix time. - Maximum date that can be stored by the database is 2106-02-07T06:59:59.999Z, or
4294969199999milliseconds from Unix time. - If the
datefield is not specified, the record is inserted with the current server time.
Request
| Method | Path | Content-Type Header |
|---|---|---|
POST | /api/v1/messages/insert | application/json |
Parameters
None.
Fields
An array of message objects.
| Field | Type | Description |
|---|---|---|
type | string | Message type. |
source | string | Message source. |
entity | string | [Required] Entity name. |
date | string | ISO date, for example 2016-05-25T00:15:00Z.Set to current server time if omitted. |
severity | string | Severity name. |
tags | object | An object containing name=value pairs, for example tags: {"path": "/", "name": "sda"}. |
message | string | Message text. |
persist | boolean | Persist message in the database. Default: true.If disabled, the message is only processed by the rule-engine. |
- Reserved fields
typeandsourcemust be specified as fields, not as tags. In case of collision, tags with the same names as reserved fields are discarded. - In order for alerts generated by the rule engine to inherit message
severity, set severity tounknownon the Logging tab in the rule editor.
Response
Fields
None.
Errors
None.
Example
Request
URI
POST /api/v1/messages/insert
Payload
[
{
"entity": "nurswgvml007",
"type": "application",
"message": "NURSWGVML007 ssh: error: connect_to port 8881: failed.",
"severity": "MAJOR",
"source": "atsd"
}
]
curl
curl https://atsd_hostname:8443/api/v1/messages/insert \
-k --user {username}:{password} \
--header "Content-Type: application/json" \
--data @file.json