> For the complete documentation index, see [llms.txt](https://docs.lenses.io/latest/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.lenses.io/latest/devx/5.5/user-guide/cli/applications/sql-processors.md).

# SQL Processors

This page describes the commands to manage SQL Processors in Lenses via the CLI.

The CLI can create, modify, pause, restart and remove Lenses SQL Processors.

## View processors <a href="#view-processors" id="view-processors"></a>

View all processors registered. Optionally filter by name, cluster and namespace.

```bash
lenses-cli processors
# filter by namespace
lenses-cli processors --namespace lenses-sql

# Please note the following columns in the table: 
# * 'ID' which should be used as the 'id' required for the commands below.
# * 'PROCESSORID' , which the user may have configured in creating the processor, and will be used as the consumer group of the processor.
```

## Create processors <a href="#create-processors" id="create-processors"></a>

For IN\_PROC you only need the name, for KUBERNETES all three. Creating an IN\_PROC processor will start it automatically. This is not the case for Kubernetes deployments, a start command (see below) is required once created.

* `--id` (the processor id, optional)
* `--name` (optional)
* `--cluster-name` (should be passed if `KUBERNETES`)
* `--namespace` (should be passed if `KUBERNETES`)
* `--runners` (number of times to deploy while in `KUBERNETES`)

```bash
lenses-cli processor create \
    --name="processorName" \
    --runners=1 \
    --cluster-name="clusterName" \
    --namespace="ns" \
    --pipeline="prod" \
    --sql="SET defaults.topic.autocreate=true;INSERT INTO topicB SELECT STREAM * FROM topic1"

```

From a file:

```bash
lenses-cli processor create ./processor.yaml
```

```yaml
name: processorName
runners: 1
sql: |-
    SET defaults.topic.autocreate=true;INSERT INTO topicB SELECT STREAM * FROM topic1
```

## Stop a processor <a href="#stop-a-processor" id="stop-a-processor"></a>

For `IN_PROC` you only need the name, for `KUBERNETES` all three:

```bash
lenses-cli processor stop \
    --cluster-name="clusterName?" \
    --namespace="namespace?" \
    --name="processorName"
```

## Start a processor <a href="#start-a-processor" id="start-a-processor"></a>

For `IN_PROC` you only need the name, for `KUBERNETES` all three:

```bash
lenses-cli processor start \
    --cluster-name="clusterName?" \
    --namespace="namespace?" \
    --name="processorName"
```

## Update the number of runners <a href="#update-a-processor-runners" id="update-a-processor-runners"></a>

Update a processor from the command line flags or files. **Only for `KUBERNETES`:**

```bash
lenses-cli processor update \
    --cluster-name="clusterName?" \
    --namespace="namespace" \
    --name="processorName" \
    --runners=2

```

From a file.

```bash
lenses-cli processor update ./processor.yaml
```

```yaml
name: processorName
runners: 1
sql: |-
    SET defaults.topic.autocreate=true;INSERT INTO topicB SELECT STREAM * FROM topic1
```

## Delete a processor <a href="#delete-a-processor" id="delete-a-processor"></a>

Delete a processor by name, cluster and namespace. For `IN_PROC` you only need the name, and for `KUBERNETES` all 3 (name, cluster, namespace).

```bash
lenses-cli processor delete \
    --namespace="namespace" \
    --cluster-name="clusterName" \
    --name="processorName
```

## View processors logs <a href="#view-processors-logs" id="view-processors-logs"></a>

**Available only for `KUBERNETES`**.

```bash
lenses-cli processors logs \
    --cluster-name=clusterName \
    --namespace=nameSpace \
    --podName=runnerStateID [--follow --lines]
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.lenses.io/latest/devx/5.5/user-guide/cli/applications/sql-processors.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
