Lens Documentation

Lens is a log routing agent that filters, enriches, and routes your logs intelligently — reducing what you send to expensive destinations like Datadog or Splunk by 40–90%.

Quickstart

Get from zero to routing logs in under 5 minutes:

1
Sign up and create an agent key

Go to the Agents tab in your dashboard and click New Agent. Copy the agent key.

2
Install the agent on your server

Run the one-line installer — it downloads the binary and writes a systemd service.

curl -sSL https://your-domain/install.sh | bash -s YOUR_AGENT_KEY
3
Create a pipeline

In the Pipelines tab, click New Pipeline. Add rules to filter or tag your logs, then set send/archive/drop thresholds.

4
Add a destination

In the Destinations tab, connect your log backend (Datadog, Elasticsearch, S3, webhook, etc.).

5
Watch savings accumulate

The Overview tab shows real-time volume, cost savings, and routing decisions.

Installing the Agent

One-line install (Linux, systemd)

curl -sSL https://your-domain/install.sh | bash -s AGENT_KEY

This installs the agent as a systemd service that starts on boot. The agent binary is placed at /usr/local/bin/lens-agent.

Docker

curl -sSL https://your-domain/install/docker/AGENT_KEY -o lens-agent.yml
docker compose -f lens-agent.yml up -d

Kubernetes (DaemonSet)

kubectl apply -f https://your-domain/install/k8s/AGENT_KEY

This deploys a DaemonSet that runs one agent per node, tailing /var/log/pods.

Manual (any platform)

# Linux amd64
curl -fsSL https://your-domain/download/lens-agent-linux-amd64 -o lens-agent
chmod +x lens-agent
AGENT_KEY=your_key DASHBOARD_URL=https://your-domain ./lens-agent

Supported platforms: linux/amd64, linux/arm64, darwin/amd64, darwin/arm64.

Environment variables

VariableRequiredDefaultDescription
AGENT_KEYYour agent key from the dashboard
DASHBOARD_URLURL of your Lens dashboard
LISTEN_OTLP_HTTP:4318OTLP HTTP receiver port
LISTEN_FLUENTD:24224Fluentd TCP receiver port
LISTEN_SYSLOGoffSyslog UDP/TCP address (e.g. :514)
FILETAIL_GLOBSComma-separated file globs to tail (e.g. /var/log/*.log)
WAL_DIR/var/lib/lens-agent/walWrite-ahead log directory
PROMETHEUS_ADDR:9090Prometheus metrics port
LENS_AUTO_UPDATEfalseEnable automatic agent binary updates

Creating Your First Pipeline

A pipeline is a set of rules that evaluate each incoming log and decide what to do with it.

  1. Go to PipelinesNew Pipeline
  2. Choose an input type (OTLP, Syslog, file, etc.)
  3. Add rules — each rule has conditions and an action
  4. Set thresholds: logs above the Send score go to your destination; between Archive and Send go to cheap storage; below Archive are dropped
  5. Assign agents to the pipeline
  6. Save and enable

Pipelines & Rules

Rule actions

ActionDescription
boostIncrease the log's score (more likely to be sent)
reduceDecrease the log's score (more likely to be archived/dropped)
force_sendAlways send this log, bypassing thresholds
force_archiveAlways archive this log
dropDiscard the log immediately
sampleKeep only N% of matching logs (e.g. keep 10% of debug logs)
parse_jsonParse a field's value as JSON and merge into the event
add_fieldAdd a static key=value field to the event
remove_fieldRemove a field from the event
redactReplace a field's value with [REDACTED]

Condition operators

OperatorDescription
=Exact match
!=Not equal
containsSubstring match (case-insensitive)
!containsDoes not contain
starts_withPrefix match
regexRegular expression match
> < >= <=Numeric comparison

Adding a Destination

Go to DestinationsNew Destination and choose a type:

TypeDescription
DatadogHTTP log intake — set your API key and site (datadoghq.com or datadoghq.eu)
ElasticsearchIndex-based — set host, port, index, and optional API key
S3Object storage — set bucket, region, prefix, and AWS credentials
Splunk HECSplunk HTTP Event Collector — set URL and token
New RelicLog API — set your ingest license key
LokiGrafana Loki push API — set URL
WebhookAny HTTP endpoint — set URL and optional headers
Destinations can be used as the primary send target or as cheap archive storage. S3 is a popular archive choice.

Agents

Each agent has a unique key that authenticates it to the dashboard. The agent:

Alerts

Go to Alerts to create metric-based alert rules. Available metrics:

MetricDescription
logs_per_minLog line throughput
bytes_per_minRaw byte volume
drop_rate_pctPercentage of logs being dropped
error_rate_pctPercentage of logs with severity=ERROR

Add notification channels (email, Slack, PagerDuty) in Settings → Alerts to receive notifications when rules fire.

Plans & Limits

FeatureFreeStarterProEnterprise
Agents310UnlimitedUnlimited
Pipelines520UnlimitedUnlimited
Destinations25UnlimitedUnlimited
Daily volume5 GB50 GB500 GBUnlimited
Retention7 days30 days90 daysCustom
SLA99.9%99.99%
Price/mo$0$29$99$299

Self-Hosting

Lens runs as a Docker Compose stack. Requirements: a Linux server with Docker and a public domain (for HTTPS).

# Download the deploy package and run:
./deploy.sh

The setup wizard prompts for your domain, database passwords, and optional integrations (OAuth, Stripe, SMTP, Anthropic).

Updating

./deploy.sh update

Logs

./deploy.sh logs

API Keys

Generate API keys in Settings → API Keys. Keys begin with lns_ and can be used as Bearer tokens:

curl -H "Authorization: Bearer lns_your_key" \
  https://your-domain/api/v1/pipelines
API keys have the same permissions as the user who created them. Rotate them regularly and never commit them to source control.