Hello World. Your First Vector Pipeline.

Building your very first Vector pipeline, the "Hello World" of Vector tutorials.
type: tutorialdomain: config

Vector is a simple beast to tame, in this guide we'll send an event through it and touch on some basic concepts.

Tutorial

  1. Install Vector

    If you haven't already, install Vector. Here's a script for the lazy:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.vector.dev | sh
    explain this command

    Or choose your preferred installation method.

  2. Configure it

    Vector runs with a configuration file that tells it which components to run and how they should interact. Let's create one that simply pipes a stdin source to a console sink:

    vector.toml
    [sources.foo]
    type = "stdin"
    [sinks.bar]
    inputs = ["foo"]
    type = "console"
    encoding.codec = "text"
    explain this command

    Every component within a Vector config has an identifier chosen by you. This allows you to specify where a sink should gather its data from (using the inputs field).

  3. Hello World!

    That's it for our first config, now pipe an event through it:

    echo 'Hello World!' | vector --config ./vector.toml
    explain this command

    Your input event will get echoed back (along with some service logs) unchanged:

    ... some logs ...
    Hello World!

    That's because the raw input text of our source was captured internally within the field message, and the text encoding.codec option of our sink prints the raw contents of message only.

Next Steps

If you expected something more interesting to happen then that's on you. The text came out unchanged because we didn't ask Vector to change it, we can remedy that by following the next guide in the series.