Skip to content

Commit

Permalink
chore(docs): update quickstart.md to use YAML (vectordotdev#18796)
Browse files Browse the repository at this point in the history
  • Loading branch information
pront authored Oct 6, 2023
1 parent f0adce7 commit 0e76fe0
Showing 1 changed file with 39 additions and 30 deletions.
69 changes: 39 additions & 30 deletions website/content/en/docs/setup/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,20 @@ Vector topologies are defined using a [configuration file][config] that tells it
* [Transforms] manipulate or change that observability data as it passes through your topology
* [Sinks] send data onwards from Vector to external services or destinations

Let's create a configuration file called `vector.toml`:

```toml filename="vector.toml"
[sources.in]
type = "stdin"

[sinks.out]
inputs = ["in"]
type = "console"
encoding.codec = "text"
Let's create a configuration file called `vector.yaml`:

```yaml filename="vector.yaml"
sources:
in:
type: "stdin"

sinks:
out:
inputs:
- "in"
type: "console"
encoding:
codec: "text"
```
Each component has a unique id and is prefixed with the type of the component, for example `sources` for a source. Our first component, `sources.in`, uses the [`stdin` source][stdin], which tells Vector to receive data over stdin and is given the ID `in`.
Expand Down Expand Up @@ -96,26 +100,31 @@ If you want to see something cool, try setting `encoding.codec = "json"` in the

## Hello Syslog!

Echoing events into the console isn't terribly exciting. Let's see what we can do with some real observability data by collecting and processing Syslog events. To do that, we'll add two new components to our configuration file. Here's our updated `vector.toml` configuration file:

```toml filename="vector.toml"
[sources.generate_syslog]
type = "demo_logs"
format = "syslog"
count = 100

[transforms.remap_syslog]
inputs = [ "generate_syslog"]
type = "remap"
source = '''
structured = parse_syslog!(.message)
. = merge(., structured)
'''

[sinks.emit_syslog]
inputs = ["remap_syslog"]
type = "console"
encoding.codec = "json"
Echoing events into the console isn't terribly exciting. Let's see what we can do with some real observability data by collecting and processing Syslog events. To do that, we'll add two new components to our configuration file. Here's our updated `vector.yaml` configuration file:

```yaml filename="vector.yaml"
sources:
generate_syslog:
type: "demo_logs"
format: "syslog"
count: 100
transforms:
remap_syslog:
inputs:
- "generate_syslog"
type: "remap"
source: |
structured = parse_syslog!(.message)
. = merge(., structured)
sinks:
emit_syslog:
inputs:
- "remap_syslog"
type: "console"
encoding:
codec: "json"
```

The first component uses the [`demo_logs` source][demo_logs], which creates sample log data that enables you to simulate different types of events in various formats.
Expand Down

0 comments on commit 0e76fe0

Please sign in to comment.