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

Enhancements #71

Merged
merged 53 commits into from May 13, 2015
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
3a59a73
Added support to Debian OS
Oct 27, 2014
7210c7d
Added a check for syslog-ng
Oct 28, 2014
b782617
Check if logs are parsed in Loggly
Oct 28, 2014
ca64536
Check if logs are parsed in Loggly
Oct 28, 2014
c217c36
Check if logs are parsed in Loggly
Oct 28, 2014
c60835a
Added support to suppress prompts
Oct 31, 2014
c53de77
Added support to suppress prompts
Oct 31, 2014
995d96a
Added support to suppress prompts
Oct 31, 2014
ac4f3f1
Added support to suppress prompts
Oct 31, 2014
8ea9e55
Added support to suppress prompts
Oct 31, 2014
6e316ad
Added support to suppress prompts
Oct 31, 2014
32cb0b8
Linux Script: Minor Bug Fix
Oct 31, 2014
743fc92
Linux Script: Bug Fix
Nov 4, 2014
48e750b
File Monitoring: Check if logs are rotated.
Nov 6, 2014
1afae10
File Monitoring: Check if logs are rotated.
Nov 11, 2014
bdddbb0
Updated Mac logs link
Nov 12, 2014
ee39dc6
Checks if log rotation is enabled on the File
Nov 20, 2014
76af2ad
Checks if log rotation is enabled on the Log files
Nov 20, 2014
65e3be8
Checks if log rotation is enabled on the Log files
Nov 20, 2014
8aff0e5
Minor modifications
Nov 21, 2014
9d3f561
Minor modifications
Nov 21, 2014
25754be
Minor modifications
Nov 21, 2014
33d993d
Added support to multiple tags
Nov 25, 2014
75c172c
Added support to multiple tags
Nov 25, 2014
f8a92a1
Added support to multiple tags
Nov 25, 2014
e083b05
Added support to multiple tags
Nov 26, 2014
5b59acb
Linux Script: Bug Fixes.
Dec 2, 2014
4669afc
Removed Log Rotation Check
Dec 2, 2014
8e33628
Removed Log Rotation Check
Dec 2, 2014
b907287
Removed Log Rotation Check
Dec 2, 2014
245c946
Bug Fixes
Dec 3, 2014
0f2b748
Bug Fixes
Dec 3, 2014
2d26c06
Remove state files on same alias
Dec 15, 2014
d642646
Bug Fixes
varshneyjayant Jan 21, 2015
c382fc1
Added troubleshooting rsyslog link
varshneyjayant Jan 23, 2015
4a6fba1
Added troubleshooting rsyslog link
varshneyjayant Jan 23, 2015
352212d
Revert "Added troubleshooting rsyslog link"
Jan 23, 2015
af0be39
Revert "Added troubleshooting rsyslog link"
Jan 23, 2015
b67a2c8
Added rsyslog troubleshooting link
Jan 23, 2015
95cb2ab
Added support to Disk Assisted queues
varshneyjayant Mar 4, 2015
bf14a8e
Added support to Directory Monitoring
varshneyjayant Mar 4, 2015
884113e
Added Mac Script
Mar 4, 2015
ded22fe
Added README
varshneyjayant Mar 4, 2015
3215989
Bug Fixes
Mar 18, 2015
62fce97
Bug fixes for syslog-ng detection
varshneyjayant Mar 24, 2015
164b2f4
Improved syslog-ng detection
varshneyjayant Mar 27, 2015
2a44bab
Improved error text
Mar 27, 2015
074e02a
Bug Fixes
varshneyjayant Apr 3, 2015
35cda1c
version number update from 1.0 to 1.1
varshneyjayant Apr 22, 2015
9afecfa
version number update from 1.12 to 1.13
varshneyjayant Apr 22, 2015
271d3cd
checks if cron is running during rollback
varshneyjayant Apr 22, 2015
6da5dad
Added script to publish on S3
varshneyjayant May 6, 2015
4d7af77
Updated Manual instructions
varshneyjayant May 6, 2015
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Added support to multiple tags

  • Loading branch information
psquickitjayant
psquickitjayant committed Nov 25, 2014
commit 33d993d0eba3b65c3d4d4c5f76f6f6d363e3cd75
@@ -9,7 +9,7 @@ source configure-linux.sh "being-invoked"
#name of the current script
SCRIPT_NAME=configure-file-monitoring.sh
#version of the current script
SCRIPT_VERSION=1.8
SCRIPT_VERSION=1.9

#file to monitor (contains complete path and file name) provided by user
LOGGLY_FILE_TO_MONITOR=
@@ -37,6 +37,9 @@ LOGGLY_FILE_TAG="file"
#format name for the conf file. Can be set by calling script
CONF_FILE_FORMAT_NAME="LogglyFormatFile"

#add tags to the logs
TAG=

########## Variable Declarations - End ##########

# executing the script for loggly to install and configure syslog
@@ -68,7 +71,10 @@ installLogglyConfForFile()

#configure loggly for Linux
installLogglyConf


#multiple tags
addTagsInConfiguration

#create 21<file alias>.conf file
write21ConfFileContents

@@ -239,6 +245,17 @@ checkFileReadPermission()

}


addTagsInConfiguration()
{
#split tags by comman(,)
IFS=, read -a array <<< "$LOGGLY_FILE_TAG"
for i in "${array[@]}"
do
TAG="$TAG tag=\\\"$i\\\" "
done
}

#function to write the contents of syslog config file
write21ConfFileContents()
{
@@ -254,7 +271,7 @@ write21ConfFileContents()
imfileStr+="\$PrivDropToGroup adm
"
fi

imfileStr+="
# File access file:
\$InputFileName $LOGGLY_FILE_TO_MONITOR
@@ -265,7 +282,7 @@ write21ConfFileContents()
\$InputRunFileMonitor
#Add a tag for file events
\$template $CONF_FILE_FORMAT_NAME,\"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [$LOGGLY_AUTH_TOKEN@41058 tag=\\\"$LOGGLY_FILE_TAG\\\"] %msg%\n\"
\$template $CONF_FILE_FORMAT_NAME,\"<%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 @@logs-01.loggly.com:514;$CONF_FILE_FORMAT_NAME
if \$programname == '$LOGGLY_FILE_TO_MONITOR_ALIAS' then ~
@@ -323,7 +340,14 @@ checkIfFileLogsMadeToLoggly()
checkIfLogsAreParsedInLoggly()
{
fileInitialLogCount=0
queryParam="syslog.appName%3A$LOGGLY_FILE_TO_MONITOR_ALIAS%20tag%3A$LOGGLY_FILE_TAG&from=-15m&until=now&size=1"
TAG_PARSER=
IFS=, read -a array <<< "$LOGGLY_FILE_TAG"
for i in "${array[@]}"
do
TAG_PARSER="$TAG_PARSER%20tag%3A$i "
done

queryParam="syslog.appName%3A$LOGGLY_FILE_TO_MONITOR_ALIAS$TAG_PARSER&from=-15m&until=now&size=1"
queryUrl="$LOGGLY_ACCOUNT_URL/apiv2/search?q=$queryParam"
searchAndFetch fileInitialLogCount "$queryUrl"
if [ "$fileInitialLogCount" -gt 0 ]; then
@@ -359,7 +383,7 @@ remove21ConfFile()
usage()
{
cat << EOF
usage: configure-file-monitoring [-a loggly auth account or subdomain] [-t loggly token (optional)] [-u username] [-p password (optional)] [-f filename] [-tag filetag (optional)] [-l filealias] [-s suppress prompts {optional)]
usage: configure-file-monitoring [-a loggly auth account or subdomain] [-t loggly token (optional)] [-u username] [-p password (optional)] [-f filename] [-tag filetag1,filetag2 (optional)] [-l filealias] [-s suppress prompts {optional)]
usage: configure-file-monitoring [-a loggly auth account or subdomain] [-r to rollback] [-l filealias]
usage: configure-file-monitoring [-h for help]
EOF
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.