# Papertrail

> Search Papertrail logs, manage systems, groups, saved searches and users, check usage and archives, and follow new log events, saved search matches and systems that go quiet.

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

## Actions

### Add system to group

Add a system to a group.

**Inputs**

- System (`system_id`, number, required): The system (sender). At least 1.
- Group (`group_id`, number, required): The group. At least 1.

**Outputs**

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

**Example output**

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

### Create group

Create a group of systems, by a name wildcard, by choosing them, or both.

**Inputs**

- Name (`name`, text, required): The group's name.
- System name wildcard (`system_wildcard`, text): Systems whose names match this belong to the group, such as `*prod*`.
- Systems (`system_ids`, list): Systems that belong to the group.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "id": 1,
    "name": "example",
    "system_wildcard": "example",
    "systems": [
      {
        "auto_delete": true,
        "hostname": "example",
        "id": 1,
        "ip_address": "example",
        "last_event_at": "example",
        "name": "example",
        "syslog": {
          "hostname": "example",
          "port": 1
        }
      }
    ]
  }
}
```

### Create saved search

Save a search, to rerun it or alert on it in Papertrail.

**Inputs**

- Name (`name`, text, required): The search's name.
- Search (`query`, text, required): The Papertrail search, such as `"access denied" OR ssh`.
- Group (`group_id`, number): The group it searches. Leave empty for All Systems. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "group": {
      "id": 1,
      "name": "example"
    },
    "id": 1,
    "name": "example",
    "query": "example"
  }
}
```

### Delete group

Delete a group. Its systems and their logs are kept.

**Inputs**

- Group (`group_id`, number, required): The group. At least 1.

**Outputs**

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

**Example output**

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

### Delete saved search

Delete a saved search.

**Inputs**

- Saved search (`search_id`, number, required): The saved search. At least 1.

**Outputs**

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

**Example output**

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

### Delete system

Remove a system (sender). Its events already received are kept.

**Inputs**

- System (`system_id`, number, required): The system (sender). At least 1.

**Outputs**

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

**Example output**

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

### Get account usage

Get how much log data the account has sent this billing period, against its plan's limit.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "log_data_transfer_hard_limit": 1,
    "log_data_transfer_plan_limit": 1,
    "log_data_transfer_used": 1,
    "log_data_transfer_used_percent": 1
  }
}
```

### Get group

Get a group's name, wildcard and systems.

**Inputs**

- Group (`group_id`, number, required): The group. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "id": 1,
    "name": "example",
    "system_wildcard": "example",
    "systems": [
      {
        "auto_delete": true,
        "hostname": "example",
        "id": 1,
        "ip_address": "example",
        "last_event_at": "example",
        "name": "example",
        "syslog": {
          "hostname": "example",
          "port": 1
        }
      }
    ]
  }
}
```

### Get saved search

Get a saved search's name, query and group.

**Inputs**

- Saved search (`search_id`, number, required): The saved search. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "group": {
      "id": 1,
      "name": "example"
    },
    "id": 1,
    "name": "example",
    "query": "example"
  }
}
```

### Get system

Get a system's name, hostname, IP address, syslog destination and when it last sent an event.

**Inputs**

- System (`system_id`, number, required): The system (sender). At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "auto_delete": true,
    "hostname": "example",
    "id": 1,
    "ip_address": "example",
    "last_event_at": "example",
    "name": "example",
    "syslog": {
      "hostname": "example",
      "port": 1
    }
  }
}
```

### Invite user

Give someone access to the account by email. Someone new to Papertrail gets an email invitation.

**Inputs**

- Email (`email`, text, required): Their email address.
- Read only (`read_only`, true/false, required): Let them only read logs, without changing settings.
- Can manage members (`manage_members`, true/false): Let them manage the account's members. This gives write access.
- Can manage billing (`manage_billing`, true/false): Let them manage billing. This gives write access.
- Can purge logs (`purge_logs`, true/false): Let them purge logs. Needs write access to every group.
- All groups (`can_access_all_groups`, true/false): Give them every group. Turn off and choose Groups to limit them to some.
- Groups (`group_ids`, list): The groups they can see when All groups is off.

**Outputs**

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

**Example output**

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

### List archives

List the account's daily or hourly log archives, with a download link for each.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": [
    {
      "_links": {
        "download": {
          "href": "example"
        }
      },
      "duration_formatted": "example",
      "end": "example",
      "filename": "example",
      "filesize": 1,
      "start": "example",
      "start_formatted": "example"
    }
  ]
}
```

### List groups

List the account's groups and the systems in each.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": [
    {
      "id": 1,
      "name": "example",
      "system_wildcard": "example",
      "systems": [
        {
          "auto_delete": true,
          "hostname": "example",
          "id": 1,
          "ip_address": "example",
          "last_event_at": "example",
          "name": "example",
          "syslog": {
            "hostname": "example",
            "port": 1
          }
        }
      ]
    }
  ]
}
```

### List log destinations

List the account's log destinations: the syslog host and port systems send to.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": [
    {
      "filter": "example",
      "id": 1,
      "syslog": {
        "description": "example",
        "hostname": "example",
        "port": 1
      }
    }
  ]
}
```

### List saved searches

List the account's saved searches with their query and group.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": [
    {
      "group": {
        "id": 1,
        "name": "example"
      },
      "id": 1,
      "name": "example",
      "query": "example"
    }
  ]
}
```

### List systems

List the systems (senders) logging to the account, with when each last sent an event.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": [
    {
      "auto_delete": true,
      "hostname": "example",
      "id": 1,
      "ip_address": "example",
      "last_event_at": "example",
      "name": "example",
      "syslog": {
        "hostname": "example",
        "port": 1
      }
    }
  ]
}
```

### List users

List the people with access to the account.

**Inputs**: None.

**Outputs**

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

**Example output**

```json
{
  "data": [
    {
      "email": "example",
      "id": 1
    }
  ]
}
```

### Register system

Add a system (sender): one that logs to a log destination by hostname, or one that logs to the standard syslog port from a fixed IP address.

**Inputs**

- Name (`name`, text, required): The name to show for the system.
- Log destination (`destination_id`, number): The log destination it sends to. Choose this or enter its port. At least 1.
- Log destination port (`destination_port`, number): The port of the log destination it sends to, instead of choosing it. From 1 to 65535.
- Hostname (`hostname`, text): The hostname its logs carry. Required with a log destination.
- IP address (`ip_address`, text): Its public IP address, for a system that logs to the standard syslog port `logs.papertrailapp.com:514` instead of a log destination.
- Last resort (`last_resort`, true/false): Catch events to the log destination that no other system's hostname matches. Lets Hostname be empty.
- Description (`description`, text): A description of the system.
- Remove when inactive (`auto_delete`, true/false): Remove the system automatically once it stops sending logs. Leave empty to use the log destination's setting.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "auto_delete": true,
    "hostname": "example",
    "id": 1,
    "ip_address": "example",
    "last_event_at": "example",
    "name": "example",
    "syslog": {
      "hostname": "example",
      "port": 1
    }
  }
}
```

### Remove system from group

Take a system out of a group.

**Inputs**

- System (`system_id`, number, required): The system (sender). At least 1.
- Group (`group_id`, number, required): The group. At least 1.

**Outputs**

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

**Example output**

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

### Remove user

Take someone's access to the account away.

**Inputs**

- User (`member`, number, required): The user. At least 1.

**Outputs**

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

**Example output**

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

### Search events

Search log events, newest first, by text, system, group or time range.

**Inputs**

- Search (`query`, text): A Papertrail search, such as `error OR timeout`. Leave empty for every event.
- System (`system_id`, text): Only events from this system.
- Group (`group_id`, number): Only events from this group's systems. At least 1.
- From (`min_time`, date and time): Only events received at or after this time.
- Until (`max_time`, date and time): Only events received at or before this time.
- After event ID (`min_id`, text): Only events newer than this event ID, such as the last search's max_id.
- Before event ID (`max_id`, text): Only events older than this event ID, such as the last search's min_id.
- Events to return (`limit`, number): How many events to return, up to 10,000. Leave empty for 1,000. From 1 to 10000.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "events": [
      {
        "display_received_at": "example",
        "facility": "example",
        "generated_at": "example",
        "hostname": "example",
        "id": "example",
        "message": "example",
        "program": "example",
        "received_at": "example",
        "severity": "example",
        "source_id": 1,
        "source_ip": "example",
        "source_name": "example"
      }
    ],
    "max_id": "example",
    "max_time_at": "example",
    "min_id": "example",
    "min_time_at": "example",
    "reached_beginning": true,
    "reached_end": true,
    "reached_record_limit": true,
    "reached_time_limit": true
  }
}
```

### Update group

Rename a group or change its wildcard. Add and remove systems with their own steps.

**Inputs**

- Group (`group_id`, number, required): The group. At least 1.
- Name (`name`, text): The group's new name.
- System name wildcard (`system_wildcard`, text): Systems whose names match this belong to the group.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "id": 1,
    "name": "example",
    "system_wildcard": "example",
    "systems": [
      {
        "auto_delete": true,
        "hostname": "example",
        "id": 1,
        "ip_address": "example",
        "last_event_at": "example",
        "name": "example",
        "syslog": {
          "hostname": "example",
          "port": 1
        }
      }
    ]
  }
}
```

### Update saved search

Change a saved search's name, query or group.

**Inputs**

- Saved search (`search_id`, number, required): The saved search. At least 1.
- Name (`name`, text, required): The search's name.
- Search (`query`, text, required): The Papertrail search.
- Group (`group_id`, number): The group it searches. Leave empty for All Systems. At least 1.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "group": {
      "id": 1,
      "name": "example"
    },
    "id": 1,
    "name": "example",
    "query": "example"
  }
}
```

### Update system

Rename a system or change its hostname, IP address, description or removal setting. Only the fields filled in change.

**Inputs**

- System (`system_id`, number, required): The system (sender). At least 1.
- Name (`name`, text): The new name to show.
- Hostname (`hostname`, text): The hostname its logs carry.
- IP address (`ip_address`, text): Its source IP address.
- Description (`description`, text): A description of the system.
- Remove when inactive (`auto_delete`, true/false): Remove the system automatically once it stops sending logs. Leave empty to use the log destination's setting.

**Outputs**

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

**Example output**

```json
{
  "data": {
    "auto_delete": true,
    "hostname": "example",
    "id": 1,
    "ip_address": "example",
    "last_event_at": "example",
    "name": "example",
    "syslog": {
      "hostname": "example",
      "port": 1
    }
  }
}
```

### Update user

Change someone's email address or access. Send every permission they should have: one left out is taken away.

**Inputs**

- User (`member`, number, required): The user. At least 1.
- Email (`email`, text): Their new email address.
- Read only (`read_only`, true/false): Let them only read logs, without changing settings.
- Can manage members (`manage_members`, true/false): Let them manage the account's members. This gives write access.
- Can manage billing (`manage_billing`, true/false): Let them manage billing. This gives write access.
- Can purge logs (`purge_logs`, true/false): Let them purge logs. Needs write access to every group.
- All groups (`can_access_all_groups`, true/false): Give them every group. Turn off and choose Groups to limit them to some.
- Groups (`group_ids`, list): The groups they can see when All groups is off.

**Outputs**

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

**Example output**

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