jakshi / loggly_rsyslog_ng Goto Github PK
View Code? Open in Web Editor NEWThis project forked from apetresc/loggly-rsyslog
Chef cookbook to configure rsyslog to send logs to Loggly
License: Apache License 2.0
This project forked from apetresc/loggly-rsyslog
Chef cookbook to configure rsyslog to send logs to Loggly
License: Apache License 2.0
I got the following error trying to use the loggly_rsyslog_ng
LWRP. Does the provider class need to be manually required?
NameError
---------
No resource, method, or local variable named `loggy_rsyslog_ng_tls' for `Chef::Provider::LogglyRsyslogNg ""'
Cookbook Trace:
---------------
/var/lib/aws/opsworks/cache.stage2/cookbooks/loggly_rsyslog_ng/providers/default.rb:38:in `block in class_from_file'
According to https://www.loggly.com/docs/rsyslog-manual-configuration/, rsyslog 7+ should be using a slightly different format:
template(name="LogglyFormat" type="string"
string="<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [TOKEN@41058 tag=\"TAG\"] %msg%\n")
# Send messages to Loggly over TCP using the template.
action(type="omfwd" protocol="tcp" target="logs-01.loggly.com" port="514" template="LogglyFormat")
This cookbook only uses the rsyslog 6 format:
$template LogglyFormat,"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [TOKEN@41058 tag=\"TAG\"] %msg%\n"
# Send messages to Loggly over TCP using the template.
*.* @@logs-01.loggly.com:514;LogglyFormat
As you note in your readme this does not work with multiple log files...
With these settings:
$InputFileName /mnt/ephemeral/logs/beta.log
$InputFileTag 21logglyappbetaconf:
$InputFileStateFile imfile-state:-mnt-ephemeral-logs-beta.log
this line is generated:
@@logs-01.loggly.com:6514;template-mnt-ephemeral-logs-beta.log
I have 9 files with unique $InputFileTag yet every log entry in loggly is repeated 9 times.
I discovered modifying the template (and all the others) like this:
if $programname == '21logglyappbetaconf' then *.* @@logs-01.loggly.com:6514;template-mnt-ephemeral-logs-beta.log
fixes the repeats. E.g. $programname must match $InputFileTag without the colon.
However, I can't get that to work with the rsyslog selector event though at least some docs hint it may be possible to combine expression based filters with facility based filters. I am happy to submit a pull request but I wanted to ask for your thoughts... Also although my rsyslogd version is 7.4.4 I seem to be using the older template style for some reason...
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.