---
title: Cloud storage
description: Ingest security log files from cloud object storage into a Lakewatch datasource with Auto Loader, and learn how Lakewatch discovers new files.
canonical_url: https://docs.databricks.com/aws/en/lakewatch/ingest-data/ingestion-methods/cloud-storage
---

# Cloud storage

> [!NOTE]
> **Beta**
>
> Lakewatch is in [Beta](https://docs.databricks.com/aws/en/release-notes/release-types.md). Workspace admins can control access to this feature from the **Previews** page. See [ Manage workspace-level previews](https://docs.databricks.com/aws/en/admin/workspace-settings/manage-previews.md#workspace).

Use the **Cloud storage** ingestion method to ingest files from a supported cloud object store. Lakewatch reads the source with [Auto Loader](https://docs.databricks.com/aws/en/ingestion/cloud-object-storage/auto-loader/index.md).

This page describes how to create a cloud storage datasource. To manage a datasource after it exists, see [Create and manage datasources](https://docs.databricks.com/aws/en/lakewatch/ingest-data/datasources/index.md).

Lakewatch ingests from Amazon S3. You can use:

* A Unity Catalog volume or external location as the source.
* Direct AWS credentials, for an S3 source not backed by a Unity Catalog external location.
* A customer-managed Amazon SQS queue for new-file notifications.

## Prerequisites

Before you create the datasource, make sure you meet the following requirements:

* **Source in Unity Catalog:** If the source is a Unity Catalog volume or external location, set it up in Unity Catalog before you create the datasource. For setup, see [Manage external locations](https://docs.databricks.com/aws/en/connect/unity-catalog/cloud-storage/manage-external-locations.md).
* **Run-as access to the source:** The datasource's [run-as identity](https://docs.databricks.com/aws/en/lakewatch/ingest-data/datasources/index.md#set-the-run-as-identity) must be able to read the source: the `READ FILES` privilege on the external location, or `READ VOLUME` on the volume. Grant this on the external location or volume in Unity Catalog, not on the identity itself. For instructions, see [Manage external locations](https://docs.databricks.com/aws/en/connect/unity-catalog/cloud-storage/manage-external-locations.md) or [Privileges for Unity Catalog volumes](https://docs.databricks.com/aws/en/volumes/privileges.md). Lakewatch ingests as the run-as identity, not as your user account, so your individual account-level access to the data isn't sufficient. Access the identity inherits from a parent catalog or schema, or from a group, also satisfies this requirement.

## Prepare your data for ingestion

Each Lakewatch datasource ingests from a single directory and reads all files using one file format. Before creating a datasource, organize your cloud storage so that each directory you plan to ingest contains:

* **One file format**: All files must be the same format (for example, all JSON, all Parquet, or all CSV). Files in different formats cause parse errors.
* **One source type**: Files should come from the same source system and share a compatible schema (for example, all AWS CloudTrail logs, or all CrowdStrike detection events). Minor schema variations within the same format are handled automatically, but mixing fundamentally different schemas in one directory isn't supported.

The following example shows a directory structure with one datasource for each top-level directory:

```text
s3://my-security-bucket/
├── cloudtrail/           ← Datasource 1 (JSON)
│   ├── 2025/01/01/
│   │   ├── event1.json.gz
│   │   └── event2.json.gz
│   └── 2025/01/02/
│       └── event3.json.gz
├── vpc-flow-logs/        ← Datasource 2 (Parquet)
│   ├── region=us-east-1/
│   │   └── flowlogs.parquet
│   └── region=us-west-2/
│       └── flowlogs.parquet
└── waf-logs/             ← Datasource 3 (JSON)
    └── waf-events.json
```

Each top-level directory becomes a separate Lakewatch datasource. Subdirectories are traversed automatically, including Hive-style partitioned paths (like `region=us-east-1/`). Lakewatch reads only the contents of the files, so path segments such as `region=us-east-1` aren't added as columns.

## Create the datasource

From **Datasources**, select **Add datasource**. Under **Custom & internal logs**, select the storage type that holds your files:

* **Unity Catalog external location:** An S3 path inside a Unity Catalog external location.
* **Unity Catalog volume:** A folder in a Unity Catalog volume.
* **Amazon S3:** An S3 path that isn't registered in Unity Catalog, read with AWS credentials that you provide.
* **Amazon S3 with SQS notifications:** An S3 location whose new files Lakewatch discovers through a customer-managed Amazon SQS queue.

The setup page for that storage type opens. Fill out the following fields:

* **Name:** Enter a unique name for the datasource (for example, `Cloudflare_WAF`).

* **Source location:** Point the datasource at the folder that contains your data. The location must be a folder, not an individual file. The fields depend on the storage type:
  * **External location** and **Subfolder (optional):** Select a Unity Catalog external location, and then select **Browse** to choose its root or a folder within it, and select **Choose folder**. You can also enter the location and subfolder directly. Leave **Subfolder** blank to ingest the whole location.
  * **Unity Catalog Volume path:** Enter the folder that contains your log files (for example, `/Volumes/catalog/schema/volume/logs/`), or select **Browse volumes**.

* **File format:** The format Lakewatch uses to parse the source data: JSON, JSONL, Parquet, CSV, or XML. The **AWS CloudTrail** and **Azure Event Hubs** presets extract each event from the JSON records array. Select **Infer with Genie** to have Genie suggest the format from a sample of your data. **Infer with Genie** isn't available for a Unity Catalog volume. When you select **CSV**, you can also [set CSV format options](https://docs.databricks.com/aws/en/lakewatch/ingest-data/ingestion-methods/cloud-storage.md#set-csv-format-options).

* **Ingest historical data:** Turn this on to also ingest the files already present at the location. It's off by default, so the datasource ingests only files that arrive after you create it. When it's on, the first run lists and ingests every existing file in the location, which can take a long time for a location with many files. This setting takes effect only when the datasource first starts.

* **Advanced settings:** Expand this optional section to configure:
  * **Schedule:** How often the ingestion job runs. Defaults to at least every 10 minutes. You can also change it later on the **Configuration** tab.
  * **Raw output table name:** The name of the raw table that Lakewatch writes source events to before parsers run. Lakewatch creates it in the datasource's folder. The name is required.
  * **Performance optimized:** Use performance-optimized compute for faster ingestion (on) or standard compute (off). Defaults to the [environment's ingestion-compute default](https://docs.databricks.com/aws/en/lakewatch/admin/workspace-config.md).

The **Amazon S3** and **Amazon S3 with SQS notifications** storage types use different location fields. See [File discovery and credentials](https://docs.databricks.com/aws/en/lakewatch/ingest-data/ingestion-methods/cloud-storage.md#file-discovery-and-credentials). **Infer with Genie** isn't available for either of these storage types.

### <a id="set-csv-format-options" />Set CSV format options

When you set **File format** to **CSV**, a **CSV format options** section appears so you can customize how Lakewatch reads your files. Select **Add CSV option** to add an option and set its value, or remove an option to use its default. Values are used exactly as entered, including spaces and empty values.

The most common options are **Header**, **Delimiter**, **Quote**, **Escape**, **Multiline**, **Encoding**, **Null value**, **Date format**, and **Timestamp format**. The other standard CSV read options appear under their option names. For the complete list and what each option does, see [CSV options](https://docs.databricks.com/aws/en/query/formats/csv.md#options).

### <a id="file-discovery-and-credentials" />File discovery and credentials

Lakewatch detects new files automatically. If the source's Unity Catalog external location has [file events](https://docs.databricks.com/aws/en/connect/unity-catalog/cloud-storage/manage-external-locations.md) configured, Lakewatch uses them. Otherwise, it lists the directory. There's no file-notification setting to configure in Lakewatch.

Lakewatch checks the external location for file events when you create the datasource and keeps using that discovery method. If you turn off file events on the external location afterward, the datasource doesn't switch to directory listing. Its runs fail with `CF_MANAGED_FILE_EVENTS_ENDPOINT_NOT_FOUND`, and Lakewatch records the failure as a [system error](https://docs.databricks.com/aws/en/lakewatch/system-health/system-errors.md). To recover, turn file events back on for the external location, or recreate the datasource.

When the source is a Unity Catalog volume or external location, Lakewatch authenticates through it. There's no separate credential or secret-scope entry. Make sure the [run-as identity](https://docs.databricks.com/aws/en/lakewatch/ingest-data/datasources/index.md#set-the-run-as-identity) can read the Unity Catalog object and its backing storage credential.

For an **Amazon S3** source, such as a CrowdStrike Falcon Data Replicator (FDR) bucket, enter the **S3 URI** of the folder and select a **Secret scope** that holds AWS credentials. Lakewatch checks access to the location after you select a scope. To store new credentials, select **Add AWS credentials** and provide a **Scope name** (a unique name for the workspace secret scope that stores the credentials), an **Access key ID**, and a **Secret access key**. To select a scope that you created yourself, see [Use an existing secret scope](https://docs.databricks.com/aws/en/lakewatch/ingest-data/ingestion-methods/cloud-storage.md#use-an-existing-secret-scope).

For **Amazon S3 with SQS notifications**, Lakewatch discovers new files through your customer-managed Amazon SQS queue instead of file events or directory listing. Enter the **S3 location** of your files and the **SQS queue URL**. Under **Authentication**, select one credential: an AWS service credential or a secret scope. Lakewatch uses it for both the S3 files and the SQS queue.

An SQS queue datasource ingests only the new files that the queue reports, so **Ingest historical data** isn't available for this storage type. If you delete the queue, the datasource's runs fail, and Lakewatch records the failure as a system error.

#### <a id="use-an-existing-secret-scope" />Use an existing secret scope

Both the **Amazon S3** and **Amazon S3 with SQS notifications** storage types can use a secret scope that you create yourself instead of one created with **Add AWS credentials**. The scope must store the credentials of an AWS Identity and Access Management (IAM) user that can access the S3 location and, for an SQS queue datasource, the queue. Store them under the following secret keys, which are case-sensitive:

* `awsAccessKeyId`: The AWS access key ID.
* `awsSecretAccessKey`: The AWS secret access key.

If either key is missing, Lakewatch rejects the scope with `Secret scope '<scope-name>' is missing required keys`.

The datasource's [run-as identity](https://docs.databricks.com/aws/en/lakewatch/ingest-data/datasources/index.md#set-the-run-as-identity) also needs the `READ` permission on the scope, because the preview, access checks, and ingestion all run as that identity. When you select **Add AWS credentials**, Lakewatch tries to grant this permission for you. For a scope you create yourself, grant it before you create the datasource.

To create the scope, store the keys, and grant `READ`, see [Create a secret scope](https://docs.databricks.com/aws/en/security/secrets/workspace-secret-scopes.md#databricks-backed), [Create a secret](https://docs.databricks.com/aws/en/security/secrets/workspace-secret-scopes.md#create-a-secret), and [Grant a user permissions on a secret scope](https://docs.databricks.com/aws/en/security/secrets/workspace-secret-scopes.md#grant-a-user-permissions-on-a-secret-scope).

### Preview the data

After you set the source location and file format, select **Test parsers** in the **Data preview** panel to run a sample through the attached parsers. The preview shows the raw data as Lakewatch writes it, with a `data` column holding each record and a `_metadata` column, alongside the parsed output. If you change settings after the preview runs, the preview is marked **Outdated**. Select **Test parsers** again to rerun it. The preview runs only on a sample, so a clean preview doesn't guarantee that every event in the source matches a parser.

By default, Lakewatch samples from the configured source. To sample from a specific folder instead, select the **Edit preview source** ![Gear icon.](https://docs.databricks.com/aws/en/images/product-icons/GearIcon.svg) gear icon next to the **Data preview** heading and then select **Use sample subfolder**. The **Preview path** shows the inherited source location and subfolder as read-only. Enter a folder within it, or select **Browse** to find one. The preview path must be a folder, not a file, and the [run-as identity](https://docs.databricks.com/aws/en/lakewatch/ingest-data/datasources/index.md#set-the-run-as-identity) must be able to read it. Unity Catalog volume datasources preview from the volume path and don't offer a separate preview path.

An **Amazon S3 with SQS notifications** datasource requires a **Preview sample folder** instead. Enter a folder within the configured source that contains sample files. Lakewatch doesn't poll the SQS queue to generate the preview.

The sample affects only the preview and isn't stored with the datasource. When the datasource runs, it ingests from its configured source.

### Time column handling

The `time` column is critical for clustering, streaming watermarks, and query performance. Lakewatch auto-detects and extracts it during setup, including when the timestamp is nested inside a VARIANT structure. The raw table stores each source record as read, with a `_metadata` column. When Lakewatch writes the parsed tables, it takes `time` from the event time that the parser defines. If every configured time source is null, it uses the ingestion timestamp (`lw_meta.ingestion_time`) instead, so each row in a parsed table has a `time` value.

## <a id="attach-parsers-and-create-the-datasource" />Attach parsers and create the datasource

On the same creation form, scroll to the **Parsers** section:

1. **Attach parsers.** Attach one or more parsers to schematize the data: a built-in parser that matches your source or one you authored. If your source delivers enveloped records, also set **Unwrapping**, described in [Unwrap enveloped records](https://docs.databricks.com/aws/en/lakewatch/ingest-data/ingestion-methods/cloud-storage.md#unwrap-enveloped-records). For how parser matching works and the columns parsers produce, see [Parsers](https://docs.databricks.com/aws/en/lakewatch/ingest-data/datasources/index.md#parsers).
2. **Create the datasource.** Select **Create datasource**. The datasource starts running immediately on its processing schedule. To stop it, [delete the datasource](https://docs.databricks.com/aws/en/lakewatch/ingest-data/datasources/index.md#manage-existing-datasources).

After creation, edit the datasource's other settings (schedule, compute, and annotations) at any time on its **Configuration** tab. See [Edit datasource settings](https://docs.databricks.com/aws/en/lakewatch/ingest-data/datasources/index.md#edit-datasource-settings).

### <a id="unwrap-enveloped-records" />Unwrap enveloped records

Some sources deliver several events inside a container rather than one record per line. Lakewatch can unwrap the container so that each event becomes its own row. Unwrapping is available when **File format** is JSON or JSONL and no preset is selected. Next to **File format**, set **Unwrapping** (the default is **None**) to match how your records are wrapped. Only the record shapes surfaced during setup are supported. Unwrapping is available for cloud storage datasources but not for the [Existing table](https://docs.databricks.com/aws/en/lakewatch/ingest-data/ingestion-methods/existing-table.md) method, which ingests a Unity Catalog table as it is.

For a JSON array of events, select **JSON array** and enter the **JSON array path**: the root-level key containing the array of events (for example, `Records`). Nested paths aren't supported. After creation, the field is labeled **JSON array key**.

For events wrapped in a CloudWatch Logs delivery envelope, select **CloudWatch Logs**. To keep the original envelope metadata on each unwrapped event, turn on **Retain CloudWatch header columns**. It's off by default. After creation, the setting is labeled **Retain CloudWatch Logs headers**.
