From Latin vector **one who carries or conveys, carrier**. [[🌲 Notes/Prometheus]] also uses this word to [describe some of it's timeseries functionality](https://prometheus.io/docs/prometheus/latest/querying/basics/) (instant vector and range vector). [[Attack vector]] is a [[Computer security]] concept. A [[Trojan horse]] is a vector, a **carrier** of something bad. A horse filled with soldiers.
Vector is a [[Observability]] data router similar to [[Benthos]] and [[Filebeat]]. It **carries** and transforms logs to whatever destination you want. It reminds me of [[Extract, transform, load]] (ETL).
> In computing, extract, transform, load (ETL) is the general procedure of copying data from one or more sources into a destination system which represents the data differently from the source(s) or in a different context than the source(s). The ETL process became a popular concept in the 1970s and is often used in data warehousing.
Vector is a lightweight and ultra-fast tool for building observability pipelines. It can be used to replace Logstash, Fluent, Telegraf, Beats, or similar tools. It has built-in support for shipping logs to [[Humio]] through the `humio_logs` sink. Can also be used for [[Amazon Web Services|AWS]] and S3. They are part of [[Datadog]].
[Request for comments about S3 source](https://github.com/timberio/vector/blob/master/rfcs/2020-09-29-4155-aws-s3-source.md) is a nice [[RFC]].
Here is the most simple example:
```
[sources.stdin]
type = "stdin"
[sinks.file]
type = "file"
inputs = ["stdin"]
path = "/home/const/vector/log_%Y-%m-%d_%H.log"
encoding = "ndjson"
```
This takes input from `stdin` and writes it to a log file. The `strftime` in `path` will be re-evaluated for every line (event) coming in from `stdin`. This eliminates the need for rotating files - every log file will be suffixed with the date and time.
File rotation, man. By the way, see [Robust and Race-free Server Logging using Named Pipes — The Art of Machinery](https://theartofmachinery.com/2020/10/10/logging_with_named_pipes.html).
> The best thing that can be done to a problem is to dissolve it, **to redesign the entity that has it or its environment so as to eliminate the problem**. Such a design incorporates common sense and research, and increases our learning more than trial-and-error or scientific research alone can.