> 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/j/json-file-web-applications.md).

# JSON File Web Applications

The JSON File Web Applications adapter imports web applications, such as WAF or load balancer virtual servers, from a JSON file that you copy to the connector.

## Use cases

* **Inventory web applications from a file.** Bring web application records into the inventory.

```
Adapters = json-file-webapps
```

* **Find applications in monitor mode.** Find applications whose WAF only monitors traffic.

```
Adapters = json-file-webapps AND MonitorMode = true
```

## Before you begin

### Network

| Source              | Destination                      | Port           | Protocol       |
| ------------------- | -------------------------------- | -------------- | -------------- |
| OctoXLabs connector | Local file on the connector host | Not applicable | Not applicable |

The adapter reads a file from disk. It makes no network connection.

### Required permissions

The connector process must be able to read the file. The baseline asks you to check the file permissions after you copy the file.

## Create credentials in JSON file

This adapter needs no credentials. Prepare the file and copy it to the connector instead.

{% stepper %}
{% step %}

### Prepare the JSON file

Create a JSON file that contains either one object or a list of objects. Each object is one record. An empty file is rejected.
{% endstep %}

{% step %}

### Copy the file to the connector

Copy the file to `/opt/octoxlabs/connector/media/json` on the connector host.
{% endstep %}

{% step %}

### Check the file permissions

Make sure the connector process can read the file, then run the connection test.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter         | Required | Type   | Default    | Description                                                                                                                                             |
| ----------------- | -------- | ------ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Filename          | Yes      | String | None       | File name or glob pattern inside the JSON folder. Absolute paths and `..` are not allowed. If a pattern matches several files, the newest file is used. |
| Primary Key Field | No       | String | PrimaryKey | JSON key with the unique identifier of each web application. A dotted path such as `info.id` reaches a nested key.                                      |

## Troubleshooting

| Error message                                                         | Cause                                                                                      | Fix                                                             |
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ | --------------------------------------------------------------- |
| Skipped {n} web application entries without a usable '{field}' value. | Some records have no primary key, or the key is not text or a number.                      | Add the key to those records or change **Primary Key Field**.   |
| File not found with this pattern.                                     | No file in the JSON folder matches **Filename**, or the match resolves outside the folder. | Copy the file to the JSON folder and check the name or pattern. |
| {filename} file is empty.                                             | The JSON file contains no data.                                                            | Add at least one record to the file.                            |

## Change history

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