> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/c/cloudfit-cfs.md).

# CloudFit CFS

CloudFit CFS stores device records in an Elasticsearch cluster. OctoXLabs reads those records through the Elasticsearch search API and adds them as devices to the inventory.

## Use cases

* List devices read from the CloudFit CFS cluster.

```
Adapters = cloudfit-cfs
```

* Find CloudFit devices not seen in the last 30 days.

```
Adapters = cloudfit-cfs AND NOT LastSeen last now-30d/d
```

## Before you begin

### Network

| Source              | Destination                        | Port                | Protocol |
| ------------------- | ---------------------------------- | ------------------- | -------- |
| OctoXLabs connector | CloudFit CFS Elasticsearch cluster | 9200 (configurable) | HTTPS    |

### Required permissions

| Scope or role                                                              | Permission | Needed for                   |
| -------------------------------------------------------------------------- | ---------- | ---------------------------- |
| Elasticsearch user or API key with search permission on the target indices | Read       | Devices (search with scroll) |

## Create credentials in CloudFit CFS

{% stepper %}
{% step %}

### Choose an auth method

Use either an Elasticsearch user with permission to search the target indices, or an API key pair. Do not provide both.
{% endstep %}

{% step %}

### Create an API key (optional)

Create the key pair with the Elasticsearch Create API Key endpoint. Enter the key ID and the key in the connection.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                  | Required | Type     | Default             | Description                                                              |
| -------------------------- | -------- | -------- | ------------------- | ------------------------------------------------------------------------ |
| IP                         | Yes      | Text     |                     | Host name or IP of the Elasticsearch cluster.                            |
| Port                       | No       | Number   | 9200                | Elasticsearch REST API port.                                             |
| Is Secure                  | No       | Boolean  | True                | Use HTTPS instead of HTTP.                                               |
| Username                   | No       | Text     |                     | Use with Password, or use the API key pair.                              |
| Password                   | No       | Password |                     | Password of the user.                                                    |
| API Key ID                 | No       | Text     |                     | ID of the API key pair.                                                  |
| API Key                    | No       | Password |                     | API key.                                                                 |
| Data Streams Search Target | No       | Text     | Empty (all indices) | Comma-separated data streams, indices or aliases. Wildcards are allowed. |
| Hostname Field             | No       | Text     | Hostname            | Field that holds the device hostname. Documents without it are skipped.  |
| Proxy                      | No       | Text     |                     | HTTP proxy URL.                                                          |
| Proxy Username             | No       | Text     |                     | Proxy credentials, if needed.                                            |
| Proxy Password             | No       | Password |                     | Proxy credentials, if needed.                                            |
| Timeout                    | No       | Number   | 30                  | Seconds to wait for responses.                                           |

## Troubleshooting

| Error message                        | Cause                                | Fix                                                                    |
| ------------------------------------ | ------------------------------------ | ---------------------------------------------------------------------- |
| Elasticsearch connection failed      | The cluster did not answer the ping. | Check IP, port, Is Secure and credentials.                             |
| Elasticsearch connection failed: ... | The test search failed.              | Read the error after the colon, for example missing index permissions. |

## Change history

{% hint style="info" %}
Available starting from version 6.7.2.
{% endhint %}
