Skip to content

Commit

Permalink
templates/packer: vector expects a yaml configuration now
Browse files Browse the repository at this point in the history
When switching to the new vector repos, the version was also bumped. The
newer versions expect a yaml config.
  • Loading branch information
croissanne authored and thozza committed Mar 7, 2024
1 parent aa15602 commit ef44f22
Showing 1 changed file with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,23 @@ echo "Writing vector config."
REGION=$(curl -Ls http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region)

sudo mkdir -p /etc/vector
sudo tee /etc/vector/vector.toml > /dev/null << EOF
[sources.journald]
type = "journald"
exclude_units = ["vector.service"]
[sinks.out]
type = "aws_cloudwatch_logs"
inputs = [ "journald" ]
region = "${REGION}"
endpoint = "${CLOUDWATCH_LOGS_ENDPOINT_URL}"
group_name = "${CLOUDWATCH_LOG_GROUP}"
stream_name = "worker_syslog_{{ host }}"
encoding.codec = "json"
sudo tee /etc/vector/vector.yaml > /dev/null << EOF
sources:
journald:
type: journald
exclude_units:
- vector.service
sinks:
out:
type: aws_cloudwatch_logs
inputs:
- journald
region: ${REGION}
endpoint: ${CLOUDWATCH_LOGS_ENDPOINT_URL}
group_name: ${CLOUDWATCH_LOG_GROUP}
stream_name: worker_syslog_{{ host }}
encoding:
codec: json
EOF

sudo systemctl enable --now vector

0 comments on commit ef44f22

Please sign in to comment.