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

Parse Environment Variables located inside log_files.yml #172

Open
johlym opened this issue Sep 26, 2016 · 3 comments
Open

Parse Environment Variables located inside log_files.yml #172

johlym opened this issue Sep 26, 2016 · 3 comments

Comments

@johlym
Copy link
Contributor

johlym commented Sep 26, 2016

Submitting this on behalf of a user. When deploying remote_syslog2 in an automated fashion, it helps to be able to use environment variables to automatically point remote_syslog2 in the right direction toward the log files of the application.

Example


files: 
- <%= ENV['MY_VAR'] %>/path/to/logfile.log 
- <%= ENV['MY_VAR'] %>/path/to/second.log 

destination: 
  host: logs.papertrailapp.com 
  port: 12345 
  protocol: tls

Note: the tags are ERB but we could possibly come up with a standard implementation of this.

@snorecone
Copy link
Contributor

I think this would typically be handled by config management, like chef, puppet, etc., and would be outside the responsibility of remote_syslog2.

That being said, it's possible to pass in a list of log files on the command line as additional arguments, so that env vars would be expanded, like:

remote_syslog -D -d a.example.com -f local0 "${MYVAR}/path/to/logfile.log" "${MYVAR}/path/to/second.log"

@johlym
Copy link
Contributor Author

johlym commented Sep 26, 2016

That makes sense, though would get a bit unwieldy beyond a handful of log files. 

Johnathan

On Mon, Sep 26, 2016 at 12:46 PM Mark Martin

<
mailto:Mark Martin notifications@github.com

wrote:

a, pre, code, a:link, body { word-wrap: break-word !important; }

I think this would typically be handled by config management, like chef, puppet, etc., and would be outside the responsibility of remote_syslog2.

That being said, it's possible to pass in a list of log files on the command line as additional arguments, so that env vars would be expanded, like:

remote_syslog -D -d a.example.com -f local0 "${MYVAR}/path/to/logfile.log" "${MYVAR}/path/to/second.log"

You are receiving this because you authored the thread.

Reply to this email directly,
#172 (comment)
, or
https://github.com/notifications/unsubscribe-auth/AFbD05_A3DzrouSKrSiiARdEvPC47FsFks5quCEwgaJpZM4KG5Sx
.

@sethherr
Copy link
Contributor

I took the log_files.yml from this template, which is referenced by Papertrail's Cloud 66 instruction.

While parsing of ENV variables in log_files.yml would be cool, there's an easier solution - if that instruction page explained that you need to replace the variables manually I wouldn't have had a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants