diff --git a/.github/actions/spelling/allow.txt b/.github/actions/spelling/allow.txt index 9a11826b00bef..360f67b173aed 100644 --- a/.github/actions/spelling/allow.txt +++ b/.github/actions/spelling/allow.txt @@ -148,6 +148,7 @@ Podcast Podkicker Positivo Prestigio +pront Proscan Qmobilevn RPZ diff --git a/Cargo.toml b/Cargo.toml index e8cc2e7844172..c3f449eff1549 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,7 @@ section = "admin" maintainer-scripts = "distribution/debian/scripts/" assets = [ ["target/release/vector", "/usr/bin/", "755"], - ["config/vector.toml", "/etc/vector/vector.toml", "644"], + ["config/vector.yaml", "/etc/vector/vector.yaml", "644"], ["config/examples/*", "/etc/vector/examples/", "644"], ["distribution/systemd/vector.service", "/lib/systemd/system/vector.service", "644"], ["distribution/systemd/vector.default", "/etc/default/vector", "600"], diff --git a/config/vector.yaml b/config/vector.yaml new file mode 100644 index 0000000000000..6e83ddf5332a4 --- /dev/null +++ b/config/vector.yaml @@ -0,0 +1,47 @@ +# __ __ __ +# \ \ / / / / +# \ V / / / +# \_/ \/ +# +# V E C T O R +# Configuration +# +# ------------------------------------------------------------------------------ +# Website: https://vector.dev +# Docs: https://vector.dev/docs +# Chat: https://chat.vector.dev +# ------------------------------------------------------------------------------ + +# Change this to use a non-default directory for Vector data storage: +# data_dir = "/var/lib/vector" + +# Random Syslog-formatted logs +sources: + dummy_logs: + type: "demo_logs" + format: "syslog" + interval: 1 + +# Parse Syslog logs +# See the Vector Remap Language reference for more info: https://vrl.dev +transforms: + parse_logs: + type: "remap" + inputs: ["dummy_logs"] + source: | + . = parse_syslog!(string!(.message)) + +# Print parsed logs to stdout +sinks: + print: + type: "console" + inputs: ["parse_logs"] + encoding: + codec: "json" + +# Vector's GraphQL API (disabled by default) +# Uncomment to try it out with the `vector top` command or +# in your browser at http://localhost:8686 +# api: +# enabled: true +# address: "127.0.0.1:8686" diff --git a/distribution/docker/README.md b/distribution/docker/README.md index fd445a43cd499..249e76c43b2df 100644 --- a/distribution/docker/README.md +++ b/distribution/docker/README.md @@ -36,7 +36,7 @@ observability data with Vector. As shown above, you can pass a custom [Vector configuration file][docs.setup.configuration] via the `-c` flag. You'll want to do this since the -[default `/etc/vector/vector.toml` configuration file][urls.default_configuration] +[default `/etc/vector/vector.yaml` configuration file][urls.default_configuration] doesn't do anything. ## Deploying @@ -128,7 +128,7 @@ Vector's Docker source files are located [docs.transforms]: https://vector.dev/docs/reference/transforms/ [pages.index#correctness]: https://vector.dev/#correctness [pages.index#performance]: https://vector.dev/#performance -[urls.default_configuration]: https://github.com/vectordotdev/vector/blob/master/config/vector.toml +[urls.default_configuration]: https://github.com/vectordotdev/vector/blob/master/config/vector.yaml [urls.docker_alpine]: https://hub.docker.com/_/alpine [urls.docker_debian]: https://hub.docker.com/_/debian [urls.rust]: https://www.rust-lang.org/ diff --git a/distribution/docker/alpine/Dockerfile b/distribution/docker/alpine/Dockerfile index c749e9fc0540a..cca2d5cb75272 100644 --- a/distribution/docker/alpine/Dockerfile +++ b/distribution/docker/alpine/Dockerfile @@ -13,7 +13,7 @@ FROM docker.io/alpine:3.18 RUN apk --no-cache add ca-certificates tzdata COPY --from=builder /vector/bin/* /usr/local/bin/ -COPY --from=builder /vector/config/vector.toml /etc/vector/vector.toml +COPY --from=builder /vector/config/vector.yaml /etc/vector/vector.yaml COPY --from=builder /var/lib/vector /var/lib/vector # Smoke test diff --git a/distribution/docker/distroless-static/Dockerfile b/distribution/docker/distroless-static/Dockerfile index 280c7d6be25d0..882b728f5dcb3 100644 --- a/distribution/docker/distroless-static/Dockerfile +++ b/distribution/docker/distroless-static/Dockerfile @@ -12,7 +12,7 @@ RUN mkdir -p /var/lib/vector FROM gcr.io/distroless/static:latest COPY --from=builder /vector/bin/* /usr/local/bin/ -COPY --from=builder /vector/config/vector.toml /etc/vector/vector.toml +COPY --from=builder /vector/config/vector.yaml /etc/vector/vector.yaml COPY --from=builder /var/lib/vector /var/lib/vector # Smoke test diff --git a/distribution/init.d/vector b/distribution/init.d/vector index 81f48df7be68b..2aeb28b640822 100644 --- a/distribution/init.d/vector +++ b/distribution/init.d/vector @@ -4,7 +4,7 @@ # # description: A lightweight and ultra-fast tool for building observability pipelines # processname: vector -# config: /etc/vector/vector.toml +# config: /etc/vector/vector.yaml # pidfile: /var/run/vector.pid ### BEGIN INIT INFO diff --git a/distribution/install.sh b/distribution/install.sh index 52833b896775d..6dbee0190ae83 100755 --- a/distribution/install.sh +++ b/distribution/install.sh @@ -224,7 +224,7 @@ install_from_archive() { printf "%s Install succeeded! 🚀\n" "$_prompt" printf "%s To start Vector:\n" "$_prompt" printf "\n" - printf "%s vector --config $prefix/config/vector.toml\n" "$_indent" + printf "%s vector --config $prefix/config/vector.yaml\n" "$_indent" printf "\n" printf "%s More information at https://vector.dev/docs/\n" "$_prompt" diff --git a/distribution/rpm/vector.spec b/distribution/rpm/vector.spec index 3a895ace15f21..8373c4ebc6ff2 100644 --- a/distribution/rpm/vector.spec +++ b/distribution/rpm/vector.spec @@ -56,7 +56,7 @@ mkdir -p %{buildroot}%{_datadir}/%{_name} mkdir -p %{buildroot}%{_unitdir} cp -a %{_builddir}/bin/vector %{buildroot}%{_bindir} -cp -a %{_builddir}/config/vector.toml %{buildroot}%{_sysconfdir}/%{_name}/vector.toml +cp -a %{_builddir}/config/vector.yaml %{buildroot}%{_sysconfdir}/%{_name}/vector.yaml cp -a %{_builddir}/config/examples/. %{buildroot}%{_sysconfdir}/%{_name}/examples cp -a %{_builddir}/systemd/vector.service %{buildroot}%{_unitdir}/vector.service cp -a %{_builddir}/systemd/vector.default %{buildroot}%{_sysconfdir}/default/vector diff --git a/src/cli.rs b/src/cli.rs index 6d21421d2a1c1..d6d655e47f148 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -62,8 +62,10 @@ impl Opts { pub struct RootOpts { /// Read configuration from one or more files. Wildcard paths are supported. /// File format is detected from the file name. - /// If zero files are specified the default config path + /// If zero files are specified the deprecated default config path /// `/etc/vector/vector.toml` will be targeted. + /// And if the aforementioned file does not exist, + /// then `/etc/vector/vector.yaml` will be used. #[arg( id = "config", short, diff --git a/src/config/cmd.rs b/src/config/cmd.rs index 078426cbe7bf2..f3c3104cfe5e8 100644 --- a/src/config/cmd.rs +++ b/src/config/cmd.rs @@ -20,8 +20,10 @@ pub struct Opts { /// Read configuration from one or more files. Wildcard paths are supported. /// File format is detected from the file name. - /// If zero files are specified the default config path + /// If zero files are specified the deprecated default config path /// `/etc/vector/vector.toml` will be targeted. + /// And if the aforementioned file does not exist, + /// then `/etc/vector/vector.yaml` will be used. #[arg( id = "config", short, diff --git a/src/config/loading/mod.rs b/src/config/loading/mod.rs index 731099710fdae..7bd8d27624afd 100644 --- a/src/config/loading/mod.rs +++ b/src/config/loading/mod.rs @@ -305,22 +305,40 @@ where } #[cfg(not(windows))] -fn default_config_paths() -> Vec { - vec![ConfigPath::File( - "/etc/vector/vector.toml".into(), - Some(Format::Toml), - )] +fn default_path() -> PathBuf { + "/etc/vector/vector.toml".into() } #[cfg(windows)] -fn default_config_paths() -> Vec { +fn default_path() -> PathBuf { let program_files = std::env::var("ProgramFiles").expect("%ProgramFiles% environment variable must be defined"); - let config_path = format!("{}\\Vector\\config\\vector.toml", program_files); - vec![ConfigPath::File( - PathBuf::from(config_path), - Some(Format::Toml), - )] + format!("{}\\Vector\\config\\vector.toml", program_files).into() +} + +fn default_config_paths() -> Vec { + #[cfg(not(windows))] + let default_path = default_path(); + + #[cfg(windows)] + let default_path = default_path(); + + let yaml_path = default_path.with_extension("yaml"); + if default_path.exists() { + warn!("DEPRECATED Using the deprecated {:?} config path as the default config location. Vector is migrating \ + to YAML as the default config format. Future Vector versions will use {:?} as the default config location.", + default_path, + yaml_path); + + vec![ConfigPath::File(default_path, Some(Format::Toml))] + } else { + warn!( + "The {:?} config path does not exist. Vector will attempt to use new default {:?} instead.", + default_path, yaml_path + ); + + vec![ConfigPath::File(yaml_path, Some(Format::Yaml))] + } } #[cfg(all( diff --git a/src/graph.rs b/src/graph.rs index e2cfd8ceef568..cf5f009b3a8f2 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -11,7 +11,7 @@ pub struct Opts { /// Read configuration from one or more files. Wildcard paths are supported. /// File format is detected from the file name. /// If zero files are specified the default config path - /// `/etc/vector/vector.toml` will be targeted. + /// `/etc/vector/vector.yaml` will be targeted. #[arg( id = "config", short, diff --git a/src/unit_test.rs b/src/unit_test.rs index fe675f6fb88ae..9e3f9416ef1b4 100644 --- a/src/unit_test.rs +++ b/src/unit_test.rs @@ -23,7 +23,7 @@ pub struct Opts { paths_yaml: Vec, /// Any number of Vector config files to test. If none are specified the - /// default config path `/etc/vector/vector.toml` will be targeted. + /// default config path `/etc/vector/vector.yaml` will be targeted. #[arg(value_delimiter(','))] paths: Vec, diff --git a/src/validate.rs b/src/validate.rs index 5800db5355b79..121b8a161a813 100644 --- a/src/validate.rs +++ b/src/validate.rs @@ -54,7 +54,8 @@ pub struct Opts { /// Any number of Vector config files to validate. /// Format is detected from the file name. /// If none are specified the default config path `/etc/vector/vector.toml` - /// will be targeted. + /// will be targeted. And if the aforementioned file does not exist, + // then `/etc/vector/vector.yaml` will be used. #[arg(env = "VECTOR_CONFIG", value_delimiter(','))] pub paths: Vec, diff --git a/website/content/en/_index.md b/website/content/en/_index.md index bbe3d02dc2258..a8cbdb0512887 100644 --- a/website/content/en/_index.md +++ b/website/content/en/_index.md @@ -45,7 +45,7 @@ platform: configure: title: "Easy to configure" description: "A simple, composable format enables you to build flexible pipelines" - filename: "/etc/vector/vector.toml" + filename: "/etc/vector/vector.yaml" below: "Configuration examples are in [TOML](https://toml.io) but Vector also supports [YAML](https://yaml.org) and [JSON](https://json.org)" # Example configs are specified in cue/examples.cue diff --git a/website/content/en/docs/administration/management.md b/website/content/en/docs/administration/management.md index 8dfc2cb51953b..735dd62ec112e 100644 --- a/website/content/en/docs/administration/management.md +++ b/website/content/en/docs/administration/management.md @@ -23,7 +23,7 @@ To manage the Vector executable directly, without a process manager: {{< tab title="Start" >}} ```bash -vector --config /etc/vector/vector.toml +vector --config /etc/vector/vector.yaml # Or supply a JSON or YAML config file ``` @@ -129,9 +129,9 @@ If you're running Vector on Windows (perhaps you installed it using [MSI]), you ```powershell C:\Program Files\Vector\bin\vector \ - --config C:\Program Files\Vector\config\vector.toml + --config C:\Program Files\Vector\config\vector.yaml -# Or supply a JSON or YAML config file +# Or supply a TOML or JSON config file ``` {{< /tab >}} @@ -147,7 +147,7 @@ If you're running Vector using [Docker], the command interface is the same acros ```bash docker run \ -d \ - -v ~/vector.toml:/etc/vector/vector.toml:ro \ + -v ~/vector.yaml:/etc/vector/vector.yaml:ro \ -p 8686:8686 \ timberio/vector:{{< version >}}-alpine ``` diff --git a/website/content/en/docs/administration/validating.md b/website/content/en/docs/administration/validating.md index 774868936bc0e..e00ae9e210cec 100644 --- a/website/content/en/docs/administration/validating.md +++ b/website/content/en/docs/administration/validating.md @@ -8,7 +8,7 @@ Vector provides a subcommand, [`validate`][validate], that checks the validity o Here's an example: ```bash -vector validate /etc/vector/vector.toml +vector validate /etc/vector/vector.yaml ``` You can also check multiple files: @@ -52,7 +52,7 @@ configured topology: These environment checks can be disabled using the [`--no-environment`][no_environment] flag: ```bash -vector validate --no-environment /etc/vector/vector.toml +vector validate --no-environment /etc/vector/vector.yaml ``` [components]: /components diff --git a/website/content/en/docs/reference/configuration/_index.md b/website/content/en/docs/reference/configuration/_index.md index 285bb6f7a875d..90c60bed02c00 100644 --- a/website/content/en/docs/reference/configuration/_index.md +++ b/website/content/en/docs/reference/configuration/_index.md @@ -213,7 +213,7 @@ vector --config /etc/vector/vector.yaml {{< tab title="TOML" >}} ```shell -vector --config /etc/vector/vector.toml +vector --config /etc/vector/vector.yaml ``` {{< /tab >}} @@ -295,7 +295,7 @@ data templating languages such as [ytt], [Jsonnet] and [Cue]. The location of your Vector configuration file depends on your installation method. For most Linux-based systems, the file can be found at -`/etc/vector/vector.toml`. +`/etc/vector/vector.yaml`. ### Multiple files diff --git a/website/content/en/docs/reference/configuration/unit-tests.md b/website/content/en/docs/reference/configuration/unit-tests.md index 80f37ffc3fa6e..3a292058bca56 100644 --- a/website/content/en/docs/reference/configuration/unit-tests.md +++ b/website/content/en/docs/reference/configuration/unit-tests.md @@ -28,7 +28,7 @@ You can execute tests within a [configuration](#configuring) file using Vector's [`test`][vector_test] subcommand: ```bash -vector test /etc/vector/vector.toml +vector test /etc/vector/vector.yaml ``` You can also specify multiple configuration files to test: diff --git a/website/content/en/docs/setup/installation/platforms/docker.md b/website/content/en/docs/setup/installation/platforms/docker.md index 8028886063e23..dea01371a7fb5 100644 --- a/website/content/en/docs/setup/installation/platforms/docker.md +++ b/website/content/en/docs/setup/installation/platforms/docker.md @@ -59,7 +59,7 @@ EOF ```shell docker run \ -d \ - -v $PWD/vector.toml:/etc/vector/vector.toml:ro \ + -v $PWD/vector.yaml:/etc/vector/vector.yaml:ro \ -p 8686:8686 \ timberio/vector:{{< version >}}-debian ``` diff --git a/website/content/en/guides/level-up/troubleshooting.md b/website/content/en/guides/level-up/troubleshooting.md index 732ab910d7167..2853179d3ca8f 100644 --- a/website/content/en/guides/level-up/troubleshooting.md +++ b/website/content/en/guides/level-up/troubleshooting.md @@ -75,7 +75,7 @@ If you see an exception in Vector's logs then we've clearly found the issue. Before you report a bug, please enable backtraces: ```bash -RUST_BACKTRACE=full vector --config=/etc/vector/vector.toml +RUST_BACKTRACE=full vector --config=/etc/vector/vector.yaml ``` Backtraces are _critical_ for debugging errors. Once you have the backtrace @@ -95,14 +95,14 @@ Vector rate limits logs in the hot path. As a result, dropping to the {{< tab title="Env Var" >}} ```shell -VECTOR_LOG=debug vector --config=/etc/vector/vector.toml +VECTOR_LOG=debug vector --config=/etc/vector/vector.yaml ``` {{< /tab >}} {{< tab title="Flag" >}} ```bash -vector --verbose --config=/etc/vector/vector.toml +vector --verbose --config=/etc/vector/vector.yaml ``` {{< /tab >}} diff --git a/website/content/en/highlights/2023-09-06-0-33-0-upgrade-guide.md b/website/content/en/highlights/2023-09-06-0-33-0-upgrade-guide.md new file mode 100644 index 0000000000000..e1b7009209440 --- /dev/null +++ b/website/content/en/highlights/2023-09-06-0-33-0-upgrade-guide.md @@ -0,0 +1,26 @@ +--- +date: "2023-09-06" +title: "0.33 Upgrade Guide" +description: "An upgrade guide that addresses breaking changes in 0.33.0" +authors: ["pront"] +release: "0.33.0" +hide_on_release_notes: false +badges: + type: breaking change +--- + +Vector's 0.33.0 release includes **deprecations**: + +1. [Default config location change](#default-config-location-change) + +We cover them below to help you upgrade quickly: + +## Upgrade guide + +### Deprecations + +#### Default config location change {#default-config-location-change} + +The default config location `/etc/vector/vector.toml` which is used by Vector `0.32.0` is now deprecated. This location will still be used in `0.33.0`. The new default path is `/etc/vector/vector.yaml`, please migrate to this new default path or specify the config path explicitly. + +Vector `0.33.0` will attempt to load `/etc/vector/vector.toml` first, and if it is not present, it will fallback to `/etc/vector/vector.yaml`. However, Vector release `0.34.0` will automatically load `/etc/vector/vector.yaml` only. diff --git a/website/cue/reference/administration/interfaces/docker_cli.cue b/website/cue/reference/administration/interfaces/docker_cli.cue index f3a41f2571675..f46e36007fb3d 100644 --- a/website/cue/reference/administration/interfaces/docker_cli.cue +++ b/website/cue/reference/administration/interfaces/docker_cli.cue @@ -30,7 +30,7 @@ administration: interfaces: docker_cli: { start: #""" docker run \ -d \ - -v \#(paths.config):/etc/vector/vector.toml:ro \ + -v \#(paths.config):/etc/vector/vector.yaml:ro \ -p \#(_api_port):\#(_api_port) \{flags} timberio/vector:{version}-{variant} """# diff --git a/website/cue/reference/cli.cue b/website/cue/reference/cli.cue index eb9072083449d..c8b37f629fff0 100644 --- a/website/cue/reference/cli.cue +++ b/website/cue/reference/cli.cue @@ -281,7 +281,7 @@ cli: { paths: _paths_arg & { description: """ Any number of Vector config files to test. If none are specified - the default config path `/etc/vector/vector.toml` will be targeted + the default config path `/etc/vector/vector.yaml` will be targeted """ } } @@ -443,7 +443,7 @@ cli: { paths: _paths_arg & { description: """ Any number of Vector config files to validate. If none are specified - the default config path `/etc/vector/vector.toml` will be targeted + the default config path `/etc/vector/vector.yaml` will be targeted """ } } @@ -535,13 +535,13 @@ cli: { VECTOR_CONFIG: { description: """ Read configuration from one or more files. Wildcard paths are supported. If no files are - specified the default config path `/etc/vector/vector.toml` is targeted. TOML, YAML and + specified the default config path `/etc/vector/vector.yaml` is targeted. TOML, YAML and JSON file formats are supported. The format to interpret the file with is determined from the file extension (`.yaml`, `.toml`, `.json`). Vector falls back to YAML if it can't detect a supported format. """ type: string: { - default: "/etc/vector/vector.toml" + default: "/etc/vector/vector.yaml" } } VECTOR_CONFIG_DIR: { @@ -649,6 +649,6 @@ cli: { // Helpers _paths_arg: { type: "list" - default: "/etc/vector/vector.toml" + default: "/etc/vector/vector.yaml" } } diff --git a/website/cue/reference/components/sinks.cue b/website/cue/reference/components/sinks.cue index 6223a396b3859..2b313dd14a2e4 100644 --- a/website/cue/reference/components/sinks.cue +++ b/website/cue/reference/components/sinks.cue @@ -559,7 +559,7 @@ components: sinks: [Name=string]: { `--require-healthy` flag: ```bash - vector --config /etc/vector/vector.toml --require-healthy + vector --config /etc/vector/vector.yaml --require-healthy ``` """ }, diff --git a/website/cue/reference/configuration.cue b/website/cue/reference/configuration.cue index cb501633edb63..c93b155256803 100644 --- a/website/cue/reference/configuration.cue +++ b/website/cue/reference/configuration.cue @@ -711,7 +711,8 @@ configuration: { title: "Location" body: """ The location of your Vector configuration file depends on your installation method. For most Linux - based systems, the file can be found at `/etc/vector/vector.toml`. + based systems, the file can be found at `/etc/vector/vector.toml`. And if the aforementioned file does + not exist, then `/etc/vector/vector.yaml` will be used. All files in `/etc/vector` are user configuration files and can be safely overridden to craft your desired Vector configuration.