driskell / log-courier

The Log Courier Suite is a set of lightweight tools created to ship and process log files speedily and securely, with low resource usage, to Elasticsearch or Logstash instances.
Other
419 stars 107 forks source link

log-courier can't seem to handle `~` for home in certain contexts. #368

Closed Lambdara closed 5 years ago

Lambdara commented 6 years ago

For example, when my persist_directory is ~/log-courier I get Registry write failed: open ~/log-courier/.log-courier.new: no such file or directory. I tried touch to create it but that didn't help. I run from the command line so permissions shouldn't matter (users are the same) but to be certain I also used chmod 777 on it, but nothing seems to work.

However if I just replace ~ with the actual home directory (absolute path) then it works fine.

Same kind of issue for ssl ca.

Lambdara commented 6 years ago

I'd like to add that it doesn't really matter if one can use ~ for home or not; but I think I literally wasted hours on this, and having documentation clearly stating this problem or an accurate error would have helped me and could help others in the future.

driskell commented 6 years ago

@Uwila ~ is a shell syntax that expands on the command line, but only if not between quotes. It's not easy to support it within configuration files without introducing new syntax, especially if it's JSON since everything is in quotes. Also if there's a valid configuration where the path to a log file includes a tilde such as "/var/log/data/~jason/*.log" then it could be confusing whether it should be expanded or not.

I may consider adding to documentation to be clear the path won't undergo any expansions or any other transformations.