Add logstash forwarder to agent.
Change-Id: I6ba34cadaf9f7d69d6b7039b9ebea9523d433fd1
This commit is contained in:
parent
975ac6820c
commit
9da13f2b85
|
@ -343,6 +343,9 @@ echo "Install the Package Installer Tool"
|
||||||
# source ${COMPASSDIR}/install/chef.sh || exit $?
|
# source ${COMPASSDIR}/install/chef.sh || exit $?
|
||||||
source ${COMPASSDIR}/install/ansible.sh || exit $?
|
source ${COMPASSDIR}/install/ansible.sh || exit $?
|
||||||
|
|
||||||
|
echo "Install log agent."
|
||||||
|
source ${COMPASSDIR}/install/logstash-forwarder.sh || exit $?
|
||||||
|
|
||||||
if [ "$FULL_COMPASS_SERVER" == "true"]; then
|
if [ "$FULL_COMPASS_SERVER" == "true"]; then
|
||||||
echo "Download and install Compass Web"
|
echo "Download and install Compass Web"
|
||||||
source ${COMPASSDIR}/install/compass_web.sh || exit $?
|
source ${COMPASSDIR}/install/compass_web.sh || exit $?
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
|
||||||
|
echo "Installing logstash-forwarder"
|
||||||
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||||
|
source $DIR/install.conf
|
||||||
|
|
||||||
|
sudo cp -rf $COMPASSDIR/misc/logstash-forwarder/logstash-forwarder.repo /etc/yum.repos.d/logstash-forwarder.repo
|
||||||
|
sudo yum -y install logstash-forwarder
|
||||||
|
sudo rm -rf /etc/logstash-forwarder.conf
|
||||||
|
sudo cp -rf $COMPASSDIR/misc/logstash-forwarder/logstash-forwarder.conf /etc/logstash-forwarder.conf
|
||||||
|
sudo mkdir -p /etc/pki/tls/certs
|
||||||
|
sudo cp -rf $COMPASSDIR/misc/logstash-forwarder/logstash-forwarder.crt /etc/pki/tls/certs/logstash-forwarder.crt
|
||||||
|
|
||||||
|
sudo systemctl restart logstash-forwarder.service
|
||||||
|
sleep 3
|
||||||
|
echo "checking if logstash-forwarder is running"
|
||||||
|
sudo systemctl status logstash-forwarder.service
|
||||||
|
if [[ "$?" != 0 ]]; then
|
||||||
|
echo "logstash-forwarder is not running"
|
||||||
|
exit
|
||||||
|
fi
|
|
@ -0,0 +1,57 @@
|
||||||
|
{
|
||||||
|
# The network section covers network configuration :)
|
||||||
|
"network": {
|
||||||
|
# A list of downstream servers listening for our messages.
|
||||||
|
# logstash-forwarder will pick one at random and only switch if
|
||||||
|
# the selected one appears to be dead or unresponsive
|
||||||
|
"servers": [ "www.stack360.io:5000" ],
|
||||||
|
|
||||||
|
# The path to your client ssl certificate (optional)
|
||||||
|
#"ssl certificate": "./logstash-forwarder.crt",
|
||||||
|
# The path to your client ssl key (optional)
|
||||||
|
#"ssl key": "./logstash-forwarder.key",
|
||||||
|
|
||||||
|
# The path to your trusted ssl CA file. This is used
|
||||||
|
# to authenticate your downstream server.
|
||||||
|
"ssl ca": "/etc/pki/tls/certs/logstash-forwarder.crt",
|
||||||
|
|
||||||
|
# Network timeout in seconds. This is most important for
|
||||||
|
# logstash-forwarder determining whether to stop waiting for an
|
||||||
|
# acknowledgement from the downstream server. If an timeout is reached,
|
||||||
|
# logstash-forwarder will assume the connection or server is bad and
|
||||||
|
# will connect to a server chosen at random from the servers list.
|
||||||
|
"timeout": 15
|
||||||
|
},
|
||||||
|
|
||||||
|
# The list of files configurations
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"paths": [
|
||||||
|
"/var/log/compass/celery.log"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
# An array of hashes. Each hash tells what paths to watch and
|
||||||
|
# what fields to annotate on events from those paths.
|
||||||
|
#{
|
||||||
|
#"paths": [
|
||||||
|
# single paths are fine
|
||||||
|
#"/var/log/messages",
|
||||||
|
# globs are fine too, they will be periodically evaluated
|
||||||
|
# to see if any new files match the wildcard.
|
||||||
|
#"/var/log/*.log"
|
||||||
|
#],
|
||||||
|
|
||||||
|
# A dictionary of fields to annotate on each event.
|
||||||
|
#"fields": { "type": "syslog" }
|
||||||
|
#}, {
|
||||||
|
# A path of "-" means stdin.
|
||||||
|
#"paths": [ "-" ],
|
||||||
|
#"fields": { "type": "stdin" }
|
||||||
|
#}, {
|
||||||
|
#"paths": [
|
||||||
|
#"/var/log/apache/httpd-*.log"
|
||||||
|
#],
|
||||||
|
#"fields": { "type": "apache" }
|
||||||
|
#}
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIFAzCCAuugAwIBAgIJAKrryFncVfJNMA0GCSqGSIb3DQEBCwUAMBgxFjAUBgNV
|
||||||
|
BAMMDSouc3RhY2szNjAuaW8wHhcNMTYwODE4MTcwNzEyWhcNMjYwODE2MTcwNzEy
|
||||||
|
WjAYMRYwFAYDVQQDDA0qLnN0YWNrMzYwLmlvMIICIjANBgkqhkiG9w0BAQEFAAOC
|
||||||
|
Ag8AMIICCgKCAgEAw4p1OVw8tMeYfk9828FiRLPhYWwHD2OCVwlKr8P3bl974I/P
|
||||||
|
PhYTkrjEEe5SDYCWNcO58MxJ5X1vB2uQGNBBUFMni+KOqbVvcbPLL4Mkf8pjLdzD
|
||||||
|
2pItE1X7UQ8p1iYBEyAnLoV4MjA7CJ4MmUtOOcCb6keHWEhyJFOj9IzkTjFCbKuL
|
||||||
|
Y0paxayQOFlkuEK2d3Aa2HXgTLh3FFUX3kRqOcGg1uxEs2awf0nwP/NwcyfAgTSe
|
||||||
|
6yqVjnb3GLYdy283FqvxW1MrZS9UAxp/tAXRgMT8I9L2wSrjnPmrabBv5I+Kuf0p
|
||||||
|
EmLmxedOCTQsRYtYGL7TmySYgGuYtt/4UNKaG9tCPBnRXuMzlRClBDIoDhwLEKzC
|
||||||
|
LlE8JKyClNgutMKcrHbWlEJiGxooyDC1H9gwkHTi3w7qF9BYYBhkXFN2Sl0mPk0m
|
||||||
|
6NMfhQUAeqI0HlOsAX/HLwSWyRl0Nr2rvVJqgbbHRF18pADitQEuc/koT9qhON5f
|
||||||
|
BReYhQZIar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z20OGTRMXZONI
|
||||||
|
CHEk1ibp8j/Q6bw1zd0jGm3KDUSx+0/Avfve/e28U4KAdNekrgQf
|
||||||
|
-----END CERTIFICATE-----
|
|
@ -0,0 +1,6 @@
|
||||||
|
[logstashforwarder]
|
||||||
|
name=logstashforwarder repository
|
||||||
|
baseurl=http://packages.elasticsearch.org/logstashforwarder/centos
|
||||||
|
gpgcheck=1
|
||||||
|
gpgkey=http://packages.elasticsearch.org/GPG-KEY-elasticsearch
|
||||||
|
enabled=1
|
Loading…
Reference in New Issue