# Axiom

> Send events to Axiom, run APL queries, manage datasets, monitors, notifiers and annotations, and follow new events, triggered and resolved monitors, new datasets and annotations.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/axiom

## Actions

### Create annotation

Mark an event, such as a deployment, on the charts of some datasets.

**Inputs**

- Type (`type`, text, required): The kind of event, in letters, numbers and hyphens, such as `production-deployment`.
- Datasets (`datasets`, list, required): The datasets whose charts show it.
- Title (`title`, text): A short summary.
- Description (`description`, text): What happened, up to 512 characters.
- Link (`url`, text): A link about it, such as the pull request.
- Time (`time`, date and time): When it happened. Leave empty for now.
- End time (`end_time`, date and time): When it ended, for an event that lasted a while.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "datasets": [
      "example"
    ],
    "description": "example",
    "endTime": "example",
    "id": "example",
    "time": "example",
    "title": "example",
    "type": "example",
    "url": "example"
  }
}
```

### Create dataset

Create a dataset to send events to.

**Inputs**

- Name (`name`, text, required): The dataset's name, unique in the organization, such as `web-logs`.
- Description (`description`, text): What the dataset holds.
- Kind (`dataset_kind`, text): What the dataset holds. Leave empty for events. One of: `axiom:events:v1` (Events), `otel:logs:v1` (OpenTelemetry logs), `otel:traces:v1` (OpenTelemetry traces), `otel:metrics:v1` (OpenTelemetry metrics).
- Retention (days) (`retention_days`, number): How many days to keep events. Leave empty for the plan's retention. At least 1.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "canWrite": true,
    "created": "example",
    "description": "example",
    "edgeDeployment": "example",
    "id": "example",
    "kind": "example",
    "labelNames": [
      "example"
    ],
    "name": "example",
    "retentionDays": 1,
    "updatedAt": "example",
    "who": "example"
  }
}
```

### Create monitor

Create a monitor that runs an APL query on a schedule and notifies when its result crosses a threshold, matches, or looks unusual.

**Inputs**

- Name (`name`, text, required): The monitor's name.
- Type (`type`, text, required): Threshold compares a number with a threshold, Match event alerts on every matching event, Anomaly detection on unusual values and New values on values not seen before. One of: `Threshold`, `MatchEvent` (Match event), `AnomalyDetection` (Anomaly detection), `NewValues` (New values).
- APL query (`apl_query`, text, required): The APL query the monitor runs, such as `['logs'] | where status >= 500 | summarize count()`.
- Comparison (`operator`, text): For a threshold or anomaly monitor: how the result compares with the threshold. One of: `Above`, `AboveOrEqual` (Above or equal), `Below`, `BelowOrEqual` (Below or equal), `AboveOrBelow` (Above or below).
- Threshold (`threshold`, number): For a threshold monitor: the value to compare with.
- Run every (minutes) (`interval_minutes`, number): How often the monitor runs, in minutes. At least 1.
- Look back (minutes) (`range_minutes`, number): How many minutes of data each run looks at. At least 1.
- Notifiers (`notifier_ids`, list): Who is told when the monitor triggers.
- Description (`description`, text): What the monitor watches.
- Column (`column_name`, text): The column of the query's result to compare, when it has more than one.
- Alert on no data (`alert_on_no_data`, true/false): Also trigger when the query returns no data.
- Notify per group (`notify_by_group`, true/false): Notify once per group of the query's result rather than once in all.
- Turned off (`disabled`, true/false): Turn the monitor off.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "alertOnNoData": true,
    "aplQuery": "example",
    "columnName": "example",
    "createdAt": "example",
    "createdBy": "example",
    "description": "example",
    "disabled": true,
    "id": "example",
    "intervalMinutes": 1,
    "name": "example",
    "notifierIds": [
      "example"
    ],
    "notifyByGroup": true,
    "operator": "example",
    "rangeMinutes": 1,
    "threshold": 1,
    "type": "example"
  }
}
```

### Create notifier

Create a notifier that emails people or posts to a Slack, Teams, Discord or other webhook.

**Inputs**

- Name (`name`, text, required): The notifier's name.
- Channel (`channel`, text, required): Where it notifies. One of: `email`, `slack` (Slack (incoming webhook)), `webhook`, `microsoftTeams` (Microsoft Teams), `discordWebhook` (Discord (webhook)).
- Email addresses (`emails`, list): For an email notifier: the addresses to notify.
- Webhook address (`url`, text): For a Slack, Teams, Discord or webhook notifier: the incoming webhook address, starting with https://.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "createdAt": "example",
    "createdBy": "example",
    "disabled": true,
    "disabledUntil": "example",
    "id": "example",
    "lastError": "example",
    "name": "example",
    "properties": {}
  }
}
```

### Delete annotation

Delete an annotation.

**Inputs**

- Annotation (`annotation_id`, text, required): The annotation's ID.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {}
}
```

### Delete dataset

Delete a dataset and, permanently, its events.

**Inputs**

- Dataset (`dataset`, text, required): The dataset.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "jobID": "example"
  }
}
```

### Delete monitor

Delete a monitor.

**Inputs**

- Monitor (`monitor_id`, text, required): The monitor.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {}
}
```

### Delete notifier

Delete a notifier. Monitors stop notifying it.

**Inputs**

- Notifier (`notifier_id`, text, required): The notifier.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {}
}
```

### Get annotation

Get an annotation's type, title, time and datasets.

**Inputs**

- Annotation (`annotation_id`, text, required): The annotation's ID.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "datasets": [
      "example"
    ],
    "description": "example",
    "endTime": "example",
    "id": "example",
    "time": "example",
    "title": "example",
    "type": "example",
    "url": "example"
  }
}
```

### Get dataset

Get a dataset's description, kind, retention and edge deployment.

**Inputs**

- Dataset (`dataset`, text, required): The dataset.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "canWrite": true,
    "created": "example",
    "description": "example",
    "edgeDeployment": "example",
    "id": "example",
    "kind": "example",
    "labelNames": [
      "example"
    ],
    "name": "example",
    "retentionDays": 1,
    "updatedAt": "example",
    "who": "example"
  }
}
```

### Get monitor

Get a monitor's query, type, threshold, schedule and notifiers.

**Inputs**

- Monitor (`monitor_id`, text, required): The monitor.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "alertOnNoData": true,
    "aplQuery": "example",
    "columnName": "example",
    "createdAt": "example",
    "createdBy": "example",
    "description": "example",
    "disabled": true,
    "id": "example",
    "intervalMinutes": 1,
    "name": "example",
    "notifierIds": [
      "example"
    ],
    "notifyByGroup": true,
    "operator": "example",
    "rangeMinutes": 1,
    "threshold": 1,
    "type": "example"
  }
}
```

### Get monitor history

List when a monitor triggered and resolved in a time range.

**Inputs**

- Monitor (`monitor_id`, text, required): The monitor.
- From (`start_time`, date and time): From this time. Leave empty for a day before Until.
- Until (`end_time`, date and time): Until this time. Leave empty for now.

**Outputs**

- `data` (list): The response from Axiom.

**Example output**

```json
{
  "data": [
    {
      "checkId": "example",
      "name": "example",
      "state": "example",
      "timestamp": "example"
    }
  ]
}
```

### Get notifier

Get a notifier's name, channel and whether failed deliveries turned it off.

**Inputs**

- Notifier (`notifier_id`, text, required): The notifier.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "createdAt": "example",
    "createdBy": "example",
    "disabled": true,
    "disabledUntil": "example",
    "id": "example",
    "lastError": "example",
    "name": "example",
    "properties": {}
  }
}
```

### List annotations

List annotations, the deployments and other events marked on charts, optionally for some datasets or a time range.

**Inputs**

- Datasets (`datasets`, list): Only annotations on these datasets.
- From (`start`, date and time): Only annotations after this time.
- Until (`end`, date and time): Only annotations before this time.

**Outputs**

- `data` (list): The response from Axiom.

**Example output**

```json
{
  "data": [
    {
      "datasets": [
        "example"
      ],
      "description": "example",
      "endTime": "example",
      "id": "example",
      "time": "example",
      "title": "example",
      "type": "example",
      "url": "example"
    }
  ]
}
```

### List dataset fields

List a dataset's fields with their types, to write queries with.

**Inputs**

- Dataset (`dataset`, text, required): The dataset.

**Outputs**

- `data` (list): The response from Axiom.

**Example output**

```json
{
  "data": [
    {
      "description": "example",
      "hidden": true,
      "name": "example",
      "type": "example",
      "unit": "example"
    }
  ]
}
```

### List datasets

List the datasets the token can read, with their kind and retention.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Axiom.

**Example output**

```json
{
  "data": [
    {
      "canWrite": true,
      "created": "example",
      "description": "example",
      "edgeDeployment": "example",
      "id": "example",
      "kind": "example",
      "labelNames": [
        "example"
      ],
      "name": "example",
      "retentionDays": 1,
      "updatedAt": "example",
      "who": "example"
    }
  ]
}
```

### List monitors

List the organization's monitors with their query, schedule and notifiers.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Axiom.

**Example output**

```json
{
  "data": [
    {
      "alertOnNoData": true,
      "aplQuery": "example",
      "columnName": "example",
      "createdAt": "example",
      "createdBy": "example",
      "description": "example",
      "disabled": true,
      "id": "example",
      "intervalMinutes": 1,
      "name": "example",
      "notifierIds": [
        "example"
      ],
      "notifyByGroup": true,
      "operator": "example",
      "rangeMinutes": 1,
      "threshold": 1,
      "type": "example"
    }
  ]
}
```

### List notifiers

List the notifiers monitors can alert: email addresses, Slack, Teams, webhooks and more.

**Inputs**: None.

**Outputs**

- `data` (list): The response from Axiom.

**Example output**

```json
{
  "data": [
    {
      "createdAt": "example",
      "createdBy": "example",
      "disabled": true,
      "disabledUntil": "example",
      "id": "example",
      "lastError": "example",
      "name": "example",
      "properties": {}
    }
  ]
}
```

### Run APL query

Run an APL query and get its rows, such as `['web-logs'] | where status >= 500 | take 100`.

**Inputs**

- APL query (`apl`, text, required): The APL query. It names the dataset, such as `['web-logs'] | summarize count() by status`.
- From (`start_time`, date and time): Only events at or after this time. Leave empty for the query's own range.
- Until (`end_time`, date and time): Only events before this time. Leave empty for now.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "fields": [
      {
        "name": "example",
        "type": "example"
      }
    ],
    "rows": [
      {}
    ],
    "status": {
      "elapsedTime": 1,
      "isPartial": true,
      "maxCursor": "example",
      "minCursor": "example",
      "rowsExamined": 1,
      "rowsMatched": 1
    }
  }
}
```

### Send events

Send one event, or several as JSON, to a dataset. Each is stamped with the time it arrives unless Timestamp field names one of its own.

**Inputs**

- Dataset (`dataset`, text, required): The dataset to send to.
- Event (`event`, object): One event, as its fields, such as `level` and `error`. Fill in this or Events as JSON.
- Events as JSON (`events_json`, text): Several events at once, as a JSON list of objects, such as `[{"level": "error"}, {"level": "info"}]`.
- Timestamp field (`timestamp_field`, text): The field holding each event's own time. Leave empty to use `_time`, or the time it arrives.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "failed": 1,
    "failures": [
      {
        "error": "example",
        "timestamp": "example"
      }
    ],
    "ingested": 1,
    "processedBytes": 1
  }
}
```

### Trim dataset

Permanently delete a dataset's events older than a number of days.

**Inputs**

- Dataset (`dataset`, text, required): The dataset.
- Days to keep (`keep_days`, number, required): Keep the events of this many most recent days; older ones are deleted. At least 1.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "jobID": "example"
  }
}
```

### Update annotation

Change an annotation. Only the fields filled in change.

**Inputs**

- Annotation (`annotation_id`, text, required): The annotation's ID.
- Type (`type`, text): The kind of event.
- Datasets (`datasets`, list): The datasets whose charts show it.
- Title (`title`, text): A short summary.
- Description (`description`, text): What happened, up to 512 characters.
- Link (`url`, text): A link about it.
- Time (`time`, date and time): When it happened.
- End time (`end_time`, date and time): When it ended.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "datasets": [
      "example"
    ],
    "description": "example",
    "endTime": "example",
    "id": "example",
    "time": "example",
    "title": "example",
    "type": "example",
    "url": "example"
  }
}
```

### Update dataset

Change a dataset's description or retention. Only the fields filled in change.

**Inputs**

- Dataset (`dataset`, text, required): The dataset.
- Description (`description`, text): The dataset's new description.
- Retention (days) (`retention_days`, number): How many days to keep events. Leave empty for the plan's retention. At least 1.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "canWrite": true,
    "created": "example",
    "description": "example",
    "edgeDeployment": "example",
    "id": "example",
    "kind": "example",
    "labelNames": [
      "example"
    ],
    "name": "example",
    "retentionDays": 1,
    "updatedAt": "example",
    "who": "example"
  }
}
```

### Update monitor

Change a monitor. Only the fields filled in change.

**Inputs**

- Monitor (`monitor_id`, text, required): The monitor.
- Name (`name`, text): The monitor's name.
- Type (`type`, text): Threshold compares a number with a threshold, Match event alerts on every matching event, Anomaly detection on unusual values and New values on values not seen before. One of: `Threshold`, `MatchEvent` (Match event), `AnomalyDetection` (Anomaly detection), `NewValues` (New values).
- APL query (`apl_query`, text): The APL query the monitor runs, such as `['logs'] | where status >= 500 | summarize count()`.
- Comparison (`operator`, text): For a threshold or anomaly monitor: how the result compares with the threshold. One of: `Above`, `AboveOrEqual` (Above or equal), `Below`, `BelowOrEqual` (Below or equal), `AboveOrBelow` (Above or below).
- Threshold (`threshold`, number): For a threshold monitor: the value to compare with.
- Run every (minutes) (`interval_minutes`, number): How often the monitor runs, in minutes. At least 1.
- Look back (minutes) (`range_minutes`, number): How many minutes of data each run looks at. At least 1.
- Notifiers (`notifier_ids`, list): Who is told when the monitor triggers.
- Description (`description`, text): What the monitor watches.
- Column (`column_name`, text): The column of the query's result to compare, when it has more than one.
- Alert on no data (`alert_on_no_data`, true/false): Also trigger when the query returns no data.
- Notify per group (`notify_by_group`, true/false): Notify once per group of the query's result rather than once in all.
- Turned off (`disabled`, true/false): Turn the monitor off.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "alertOnNoData": true,
    "aplQuery": "example",
    "columnName": "example",
    "createdAt": "example",
    "createdBy": "example",
    "description": "example",
    "disabled": true,
    "id": "example",
    "intervalMinutes": 1,
    "name": "example",
    "notifierIds": [
      "example"
    ],
    "notifyByGroup": true,
    "operator": "example",
    "rangeMinutes": 1,
    "threshold": 1,
    "type": "example"
  }
}
```

### Update notifier

Rename a notifier or change its email addresses or webhook address. Only the fields filled in change.

**Inputs**

- Notifier (`notifier_id`, text, required): The notifier.
- Name (`name`, text): The notifier's new name.
- Email addresses (`emails`, list): For an email notifier: the addresses to notify.
- Webhook address (`url`, text): For a Slack, Teams, Discord or webhook notifier: the incoming webhook address, starting with https://.

**Outputs**

- `data` (object): The response from Axiom.

**Example output**

```json
{
  "data": {
    "createdAt": "example",
    "createdBy": "example",
    "disabled": true,
    "disabledUntil": "example",
    "id": "example",
    "lastError": "example",
    "name": "example",
    "properties": {}
  }
}
```
