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

Add TLS support for file monitoring #88

Merged
merged 13 commits into from Oct 10, 2017

Add line breaks in the script's configuration

  • Loading branch information
Shwetajain148
Shwetajain148 committed May 17, 2017
commit 8b74a32553d5186c4e5345aa934bb90647e4cdd7
@@ -427,24 +427,29 @@ write21ConfFileContents()
\$InputFileSeverity info
\$InputFilePersistStateInterval 20000
\$InputRunFileMonitor
#Add a tag for file events
template (name=\"$CONF_FILE_FORMAT_NAME\" type=\"string\" string=\"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [$LOGGLY_AUTH_TOKEN@41058 $TAG] %msg%\n\")

This comment has been minimized.

@mostlyjason

mostlyjason Aug 30, 2017
Contributor

How is $TAG set?

This comment has been minimized.

@Shwetajain148

Shwetajain148 Sep 1, 2017
Author Contributor

@mostlyjason, From the very beginning, the default tag i.e. file is set into the LOGGLY_FILE_TAG variable if the user has not provided one externally using the parameter -tag in the command. Please refer the below code line-

Ref: https://github.com/loggly/install-script/blob/master/Modular%20Scripts/File%20Monitoring/configure-file-monitoring.sh#L37

Now, the user can pass multiple tags externally which get stored into the same LOGGLY_FILE_TAG variable separated by a comma and iterate inside the addTagsInConfiguration function and finally set into the $TAG variable. Please refer the below code line-

Ref: https://github.com/loggly/install-script/blob/master/Modular%20Scripts/File%20Monitoring/configure-file-monitoring.sh#L347

Once $TAG is set with either one or multiple tags, the same variable is used in the file-monitoring configuration. Please refer the below code line-

Ref: https://github.com/loggly/install-script/blob/master/Modular%20Scripts/File%20Monitoring/configure-file-monitoring.sh#L427

This is how $TAG set.

This comment has been minimized.

@mostlyjason

mostlyjason Sep 1, 2017
Contributor

Okay we should document how to set tags in https://www.loggly.com/docs/configure-syslog-script/. I don't see any descriptions for that parameter

This comment has been minimized.

@Shwetajain148

Shwetajain148 Sep 4, 2017
Author Contributor

@mostlyjason, I have added a Note to tell the users that how they can set the tag for all three file-monitoring, Nginx and Apache script on the document https://www.loggly.com/docs/configure-syslog-script/. I added this information after the Script Usage section, please review.

if \$programname == '$LOGGLY_FILE_TO_MONITOR_ALIAS' then action(type=\"omfwd\" protocol=\"tcp\" target=\"logs-01.loggly.com\" port=\"6514\" template=\"$CONF_FILE_FORMAT_NAME\")
if \$programname == '$LOGGLY_FILE_TO_MONITOR_ALIAS' then stop
"
imfileStrNonTls="
\$ModLoad imfile
\$InputFilePollInterval 10
\$WorkDirectory $RSYSLOG_DIR
# File access file:
\$InputFileName $FILE_TO_MONITOR
\$InputFileTag $LOGGLY_FILE_TO_MONITOR_ALIAS
\$InputFileStateFile stat-$STATE_FILE_ALIAS
\$InputFileSeverity info
\$InputFilePersistStateInterval 20000
\$InputRunFileMonitor
#Add a tag for file events
template (name=\"$CONF_FILE_FORMAT_NAME\" type=\"string\" string=\"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [$LOGGLY_AUTH_TOKEN@41058 $TAG] %msg%\n\")
if \$programname == '$LOGGLY_FILE_TO_MONITOR_ALIAS' then action(type=\"omfwd\" protocol=\"tcp\" target=\"logs-01.loggly.com\" port=\"514\" template=\"$CONF_FILE_FORMAT_NAME\")
if \$programname == '$LOGGLY_FILE_TO_MONITOR_ALIAS' then stop
"
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.