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 75c172c26efd5639995398db49211b33fcda1d8a
@@ -9,7 +9,7 @@ source configure-linux.sh "being-invoked"
#name of the current script
SCRIPT_NAME=configure-apache.sh
#version of the current script
SCRIPT_VERSION=1.4
SCRIPT_VERSION=1.5

#we have not found the apache version yet at this point in the script
APP_TAG="\"apache-version\":\"\""
@@ -36,6 +36,12 @@ MANUAL_CONFIG_INSTRUCTION="Manual instructions to configure Apache2 is available

#this variable will hold if the check env function for linux is invoked
APACHE_ENV_VALIDATED="false"

#apache as tag sent with the logs
LOGGLY_FILE_TAG="apache"

#add tags to the logs
TAG=
########## Variable Declarations - End ##########

#check if apache environment is compatible for Loggly
@@ -64,7 +70,10 @@ installLogglyConfForApache()

#configure loggly for Linux
installLogglyConf


#multiple tags
addTagsInConfiguration

#create 21apache.conf file
write21ApacheConfFile

@@ -118,6 +127,7 @@ checkApacheDetails()
#set all the required apache variables by this script
setApacheVariables

#to check logrotation
checkIfLogRotationEnabled
}

@@ -237,6 +247,15 @@ write21ApacheConfFile()
fi
}

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 apache syslog config file
write21ApacheFileContents()
{
@@ -271,7 +290,7 @@ write21ApacheFileContents()
\$InputRunFileMonitor
#Add a tag for apache events
\$template LogglyFormatApache,\"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [$LOGGLY_AUTH_TOKEN@41058 tag=\\\"apache\\\"] %msg%\n\"
\$template LogglyFormatApache,\"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% [$LOGGLY_AUTH_TOKEN@41058 $TAG] %msg%\n\"
if \$programname == 'apache-access' then @@logs-01.loggly.com:514;LogglyFormatApache
if \$programname == 'apache-access' then ~
@@ -333,7 +352,14 @@ checkIfApacheLogsMadeToLoggly()
checkIfLogsAreParsedInLoggly()
{
apacheInitialLogCount=0
queryParam="tag%3Aapache%20logtype%3Aapache&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="logtype%3Aapache$TAG_PARSER&from=-15m&until=now&size=1"
queryUrl="$LOGGLY_ACCOUNT_URL/apiv2/search?q=$queryParam"
searchAndFetch apacheInitialLogCount "$queryUrl"
logMsgToConfigSysLog "INFO" "INFO: Verifying if the Apache logs are parsed in Loggly."
@@ -359,7 +385,7 @@ remove21ApacheConfFile()
usage()
{
cat << EOF
usage: configure-apache [-a loggly auth account or subdomain] [-t loggly token (optional)] [-u username] [-p password (optional)] [-s suppress prompts {optional)]
usage: configure-apache [-a loggly auth account or subdomain] [-t loggly token (optional)] [-u username] [-p password (optional)] [-tag filetag1,filetag2 (optional)] [-s suppress prompts {optional)]
usage: configure-apache [-a loggly auth account or subdomain] [-r to rollback]
usage: configure-apache [-h for help]
EOF
@@ -388,6 +414,10 @@ while [ "$1" != "" ]; do
-p | --password ) shift
LOGGLY_PASSWORD=$1
;;
-tag| --filetag ) shift
LOGGLY_FILE_TAG=$1
echo "File tag: $LOGGLY_FILE_TAG"
;;
-r | --rollback )
LOGGLY_ROLLBACK="true"
;;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.