# Streams Via Config Files

> For the complete documentation index, see [llms.txt](https://docs.redpanda.com/llms.txt). Component-specific: [connect-full.txt](https://docs.redpanda.com/connect-full.txt)

---
title: Streams Via Config Files
latest-connect-version: 4.93.0
latest-operator-version: v26.1.4
latest-console-tag: v3.7.3
latest-redpanda-tag: v26.1.9
docname: streams_mode/using_config_files
page-component-name: connect
page-version: master
page-component-version: master
page-component-title: Connect
page-relative-src-path: streams_mode/using_config_files.adoc
page-edit-url: https://github.com/redpanda-data/rp-connect-docs/edit/main/modules/guides/pages/streams_mode/using_config_files.adoc
page-git-created-date: "2024-05-24"
page-git-modified-date: "2024-09-05"
---

<!-- Source: https://docs.redpanda.com/connect/guides/streams_mode/using_config_files.md -->

When running Redpanda Connect in `streams` mode it’s possible to create streams with their own static configurations, simply list one or more files after the `streams` subcommand:

```bash
rpk connect streams ./foo.yaml ./configs/*.yaml
```

## [](#resources)Resources

A stream configuration should only include the base stream component fields (`input`, `buffer`, `pipeline`, `output`), and therefore should NOT include any [resources](https://docs.redpanda.com/connect/configuration/resources/). Instead, define resources separately and import them using the `-r`/`--resources` flag:

```bash
rpk connect streams -r "./resources/prod/*.yaml" ./stream_configs/*.yaml
```

## [](#walkthrough)Walkthrough

Make a directory of stream configs:

```bash
$ mkdir ./streams

$ cat > ./streams/foo.yaml <<EOF
input:
  http_server: {}
pipeline:
  threads: 4
  processors:
    - mapping: 'root = {"id": this.user.id, "content": this.body.content}'
output:
  http_server: {}
EOF

$ cat > ./streams/bar.yaml <<EOF
input:
  kafka:
    addresses:
      - localhost:9092
    topics:
      - my_topic
pipeline:
  threads: 1
  processors:
    - mapping: 'root = this.uppercase()'
output:
  elasticsearch:
    urls:
    - http://localhost:9200
EOF
```

Run Redpanda Connect in streams mode, pointing to our directory of streams:

```bash
rpk connect streams ./streams/*.yaml
```

On a separate terminal you can query the set of streams loaded:

```bash
curl http://localhost:4195/streams | jq '.'
{
  "bar": {
    "active": true,
    "uptime": 19.381001424,
    "uptime_str": "19.381001552s"
  },
  "foo": {
    "active": true,
    "uptime": 19.380582951,
    "uptime_str": "19.380583306s"
  }
}
```

You can also query a specific stream to see the loaded configuration:

```bash
curl http://localhost:4195/streams/foo | jq '.'
{
  "active": true,
  "uptime": 69.334717193,
  "uptime_str": "1m9.334717193s",
  "config": {
    "input": {
      "http_server": {
        "address": "",
        "cert_file": "",
        "key_file": "",
        "path": "/post",
        "timeout": "5s"
      }
    },
    "buffer": {
      "memory": {
        "limit": 10000000
      }
    },
    "pipeline": {
      "processors": [
        {
          "mapping": "root = {\"id\": this.user.id, \"content\": this.body.content}",
        }
      ],
      "threads": 4
    },
    "output": {
      "http_server": {
        "address": "",
        "cert_file": "",
        "key_file": "",
        "path": "/get",
        "stream_path": "/get/stream",
        "timeout": "5s"
      }
    }
  }
}
```

You can then send data to the stream via its namespaced URL:

curl http://localhost:4195/foo/post -d '{"user":{"id":"foo"},"body":{"content":"bar"}}'

There are other endpoints [in the REST API](https://docs.redpanda.com/connect/guides/streams_mode/using_rest_api/) for creating, updating and deleting streams.