Metrics via exec on Linux #22655
-
Hello, I am trying to bring some linux host metrics via vector's exec command in source.
I have avoided using $ symbols as it escapes in vector as an environment variable. and used Write-Output to dump it into a variable.
Is there way to run exec command without variable names or not let $var names escape? I have gone through host_metrics and dont find any viable way to get direct cpu information. I would also be using these to fetch memory and disk information, so any help is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
For exec and running cpu metrics specifically, I have gotten a solution to follow for now
I am fetching the entire CPU metric result containing all values, since I can't use |
Beta Was this translation helpful? Give feedback.
-
Hi @abubakr-cgs, take a look at https://vector.dev/docs/reference/configuration/#escaping
Also, you can rewrite the above without a variable:
|
Beta Was this translation helpful? Give feedback.
Hey @pront , apologies for the late reply.
Using a double dollar sign is currently working good, according to this https://vector.dev/docs/reference/configuration/#escaping
Linux YAML
Result
Thanks for your help!