# PulseAI server log importer

Use this connector when you can export **Apache/Nginx combined access logs**, **Caddy JSON access logs** or **Amazon CloudFront standard tab-delimited access logs**. Plain files and gzip files ending in `.gz` are supported. The website may use any hosting provider; it does not need Cloudflare. This is a read-only import of files you supply, not an automatic cloud/CDN log drain or a browser tracking script.

## Before subscribing

Confirm your host gives you the relevant access logs and permits processing them. A managed builder or store does not necessarily expose its server/CDN logs. Shopify, Wix and Squarespace have no direct ready-to-install PulseAI app in this release. Ask support about your exact setup before purchasing.

Logs contain only what that source recorded. Origin logs miss cache hits served by an upstream CDN; use the appropriate edge logs if available. Do not add origin logs and overlapping CDN logs for the same requests and expect automatic cross-source deduplication. Choose one authoritative source for a coverage window. A single import is not evidence of complete traffic coverage.

## Files and runtime

Download both files into the same private tools directory:

- [pulseai-log-import.mjs](https://pulseaianalytics.com/downloads/pulseai-log-import.mjs)
- [pulseai-node-collector.mjs](https://pulseaianalytics.com/downloads/pulseai-node-collector.mjs)

Use Node.js 22.13 or newer with its built-in SQLite support. Choose a persistent writable data directory outside the website's public document root. One process may use a data directory at a time; stop another Node collector using that directory before importing, or give the log importer its own directory permanently bound to the same website. Read the [Node runtime guide](https://pulseaianalytics.com/downloads/pulseai-node-install.md) for filesystem permissions and queue recovery.

## Account and private configuration

1. Sign in at https://pulseaianalytics.com/dashboard using the purchasing account.
2. Add the exact hostname, publish its displayed HTTPS ownership proof and verify it.
3. Copy the nonsecret Website ID and one-time ingestion key. Paid delivery requires a current server-verified subscription. Starter is $29/month for one website, with 100,000 events/month and 30-day retention.
4. Set these environment variables privately in your server or scheduled-job configuration. Do not place the key in browser code, a public file, a screenshot or a repository:

```text
PULSEAI_SITE_ID=your_website_id
PULSEAI_CUSTOMER_HOSTNAME=www.example.com
PULSEAI_INGESTION_KEY=your_private_ingestion_key
PULSEAI_DATA_DIRECTORY=/var/lib/pulseai-log-queue
PULSEAI_PUBLIC_DIRECTORY=/var/www/example/public
PULSEAI_PUBLIC_PATHS_JSON=["/","/pricing","/product"]
```

The hostname must match the verified website. For combined logs, use a log file dedicated to that hostname: combined format has no virtual-host field, so this importer cannot distinguish multiple sites in a shared file. Caddy JSON records must name the configured host. Only eligible GET requests on the exact configured public paths are imported; review paths carefully and exclude sensitive routes. Default coverage is the homepage only. A log entry alone can't verify a visitor. Requests with no automation evidence are shown as Estimated human.

## Import a file

```sh
node pulseai-log-import.mjs --file /private/exports/access-2026-10-31.log --format combined --source access_2026_10_31
```

For a Caddy JSON export:

```sh
node pulseai-log-import.mjs --file /private/exports/caddy-2026-10-31.jsonl --format caddy-json --source caddy_2026_10_31
```

`--source` is a stable identifier for that particular exported/rotated file: letters, digits, underscore or hyphen, at most 100 characters. Use the **same source identifier and unchanged lines** when retrying that file. IDs include the website, source identifier, original line number and a hash of the original line. Repeating the unchanged file reuses IDs, allowing the receiver to acknowledge duplicates without charging usage twice. Do not sort, truncate, rewrite or reuse a source ID for a different file. A new copy or renamed file of the same export should keep the original source identifier.

### Amazon CloudFront exports

Download an authorized standard-log export from your existing AWS log destination, preserving its original `#Fields:` header. This tool does not connect to AWS, provision a log destination or obtain AWS credentials. Your administrator must enable/export logs with suitable account permissions first; logging/export costs are separate from PulseAI.

```sh
node pulseai-log-import.mjs --file /private/exports/cloudfront-2026-10-31.gz --format cloudfront --source cloudfront_2026_10_31
```

Supported input is tab-delimited CloudFront standard log records containing `date`, `time`, `cs-method`, `x-host-header`, `cs-uri-stem`, `sc-status` and `cs(User-Agent)`. Preserve all header names, including their case. Optional `time-taken` supplies response latency. The importer binds records to the **viewer hostname in `x-host-header`**, not the distribution name in `cs(Host)`. Records for another hostname are ignored. Missing/duplicate required headers fail the import; unsupported fields, queries and cookies are not sent. Referrers are reduced to a type and source name. IPs remain local unless recent-request operator verification is explicitly enabled. HTTP status `000` is ignored because no normal server response was recorded. Other CloudFront real-time/custom JSON/Parquet formats require conversion or a separate connector; do not rename them and assume compatibility. [AWS standard log format reference](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/standard-logs-reference.html).

The original observed time is preserved. The receiver accepts records no older than seven days or more than five minutes in the future; the importer explicitly counts records outside that window as expired. Thirty-day dashboard retention does not imply thirty-day historical backfill support.

## Check delivery, then schedule deliberately

The command prints bounded counts and queue health only. `queued` means accepted into the local queue, not proven new dashboard rows. `ignored` covers unsupported/malformed or oversized lines, non-GET requests and unlisted paths. Lines exceeding 16 KiB are discarded with bounded memory. `expired` covers the timestamp window. `unavailable` means the queue refused an otherwise eligible record; inspect local queue diagnostics and bounds. `rejectedDuringImport` reports new queue/receiver rejections during this run. Pending delivery, rejected records and receiver duplicate acknowledgements must be reconciled separately.

- Exit 0: no pending queue and no queue refusals at the final check.
- Exit 2: pending/refused records, new delivery rejections or unreadable queue health; preserve the queue and investigate.
- Exit 1: configuration or file access failed; raw logs and credentials are not printed.

The queue persists records before delivery. It batches bounded payloads to the fixed production HTTPS endpoint, does not follow redirects, retries with backoff and deletes only acknowledged IDs or explicit receiver time rejections. Billing, key and quota problems pause delivery. The queue is bounded at 10,000 pending records and seven days; it is not an unlimited archive. After a network failure, rerun the same command and source ID using the same data directory. Backoff can mean delivery remains pending until a later run.

This release does not install a scheduler. If your administrator schedules repeated imports, avoid overlapping processes, preserve immutable export/source identities, process files within seven days and monitor exit status. Never grant the job broader log or key access than required.

Open Connections in PulseAI, verify the last receipt, choose the correct UTC dates and reconcile a small known file before relying on a scheduled import. Check body/status/cache behavior of the website separately; reading an exported log does not alter website responses.

## Privacy and identification limits

Raw logs stay on the machine running the importer. It reads them to extract timestamp, method, reviewed path, status and a temporary user-agent string for classification. The event endpoint receives only minimized records, never IPs, full referrers, query strings, cookies, authorization headers, request bodies or page contents. With PULSEAI_LOG_VERIFY_OPERATORS=true, eligible recent records can separately send their original-client IP to the verification endpoint; the returned receipt is queued, and the IP is discarded. Original lines are hashed in memory to make retry IDs; raw lines are not stored in the queue.

Crawler names in user-agent strings remain self-reported claims. Recognized automation markers can be suspected automation. All other requests are shown as Estimated human, including ordinary-browser AI agents. Logs don't record browser headers, so browser-consistency signals don't apply; bursts of more than 20 requests in 10 seconds from one client are flagged as suspected. Importing more platforms does not improve identification accuracy. There is no blocking in this connector.

For unsupported log formats, custom integration must follow the [server delivery protocol](https://pulseaianalytics.com/downloads/pulseai-ingestion-protocol.md). Do not paste visitor logs into support; send only the domain, connector version, counts and a redacted error code.

## November 1 operator verification update

Read the [verification, privacy and upgrade guide](https://pulseaianalytics.com/downloads/pulseai-operator-verification.md) before enabling the new network checks. The current catalog includes 227 reviewed names. Supported recent requests can obtain a request-bound official-network verification receipt; raw IPs never enter the durable queue or event records. Preserve your existing IDs, keys and pending queue when upgrading. Set PULSEAI_LOG_VERIFY_OPERATORS=true only after confirming the source IP field is trustworthy; requests older than 15 minutes remain unverified.

## Browser visits and Visitors

Log imports report requests present in the supplied files. To also see browser-visit estimates in **Visitors**, install the complementary [page tag](https://pulseaianalytics.com/downloads/pulseai-page-tag.md) on your public pages using the same verified Website ID. The tag adds page views, sessions, engagement and browser-input signals; it does not replace log collection or verify that a visitor is a person. Unrecognized agents can remain in Estimated human totals, and false positives can exclude people.

The tag uses localStorage and sends per-page IDs for updates, without a persistent visitor ID. Review your privacy notice and applicable consent requirements before installing it. Each tag page view uses one event from your monthly allowance in addition to imported request events; tag updates use no additional events.
