Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vector validate doesn't respect --log-format #21267

Open
josh-m-sharpe opened this issue Sep 11, 2024 · 2 comments
Open

vector validate doesn't respect --log-format #21267

josh-m-sharpe opened this issue Sep 11, 2024 · 2 comments
Labels
domain: cli Anything related to Vector's CLI type: bug A code related bug.

Comments

@josh-m-sharpe
Copy link

josh-m-sharpe commented Sep 11, 2024

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

We're launching vector with --log-format json

If I monitor journalctl -u vector -f I see output like below which is not JSON. And I'm fairly certain based on the messaging it's not systemd/journal that's creating those messages. This makes it somewhat difficult to pipe vector logs from journalctl off the system since some are JSON formatted and others are not. These also don't have timestamps or log level appended the way the JSON formatted logs do.

o│Sep 11 02:51:10 ip-10-20-11-15.us-east-2.compute.internal vector[350465]: √ Loaded ["/etc/vector/vector.yaml"]
y│Sep 11 02:51:10 ip-10-20-11-15.us-east-2.compute.internal vector[350465]: √ Component configuration
 │Sep 11 02:51:10 ip-10-20-11-15.us-east-2.compute.internal vector[350465]: √ Health check "loki_sink_journald"
(│Sep 11 02:51:10 ip-10-20-11-15.us-east-2.compute.internal vector[350465]: ------------------------------------
m│Sep 11 02:51:10 ip-10-20-11-15.us-east-2.compute.internal vector[350465]:                            Validated

Configuration

No response

Version

vector 0.41.0 (aarch64-unknown-linux-gnu 97952b5 2024-09-09 16:10:33.247365706)

Debug Output

No response

Example Data

No response

Additional Context

No response

References

No response

@josh-m-sharpe josh-m-sharpe added the type: bug A code related bug. label Sep 11, 2024
@josh-m-sharpe
Copy link
Author

josh-m-sharpe commented Sep 11, 2024

I see now these lines appear to be related to ExecReload=/usr/bin/vector validate in my systemd file. But upon fiddling a bit more It seems that vector validate doesn't support --log-format JSON.

So, the problem is the same. The lines that end up in journald are mixed formatting and it makes getting them off the system and in a viewable tool (loki, grafana in my case) much more difficult than it would be if all the logs were JSON.

@jszwedko
Copy link
Member

Thanks for this report @josh-m-sharpe . It does appear that vector validate doesn't respect --log-format. I'll update the issue title here.

@jszwedko jszwedko changed the title --log-format json sends lines that aren't json to journal vector validate doesn't respect --log-format Sep 11, 2024
@jszwedko jszwedko added the domain: cli Anything related to Vector's CLI label Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: cli Anything related to Vector's CLI type: bug A code related bug.
Projects
None yet
Development

No branches or pull requests

2 participants