Vector is a simple beast to tame, in this guide we'll send an event through it and touch on some basic concepts.
Tutorial
Install Vector
If you haven't already, install Vector. Here's a script for the lazy:
- For Humans
- For Machines
curl --proto '=https' --tlsv1.2 -sSf https://sh.vector.dev | shexplain this commandConfigure 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 aconsole
sink:vector.toml[sources.foo]type = "stdin"[sinks.bar]inputs = ["foo"]type = "console"encoding.codec = "text"explain this commandEvery 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).Hello World!
That's it for our first config, now pipe an event through it:
echo 'Hello World!' | vector --config ./vector.tomlexplain this commandYour 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 thetext
encoding.codec
option of our sink prints the raw contents ofmessage
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.