|
|
@ -45,3 +45,39 @@ systemctl enable elasticsearch.service
|
|
|
|
### XXX Prometheus :)
|
|
|
|
### XXX Prometheus :)
|
|
|
|
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
# Setting up logging from rsyslog to Elasticsearch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# On client machine:
|
|
|
|
|
|
|
|
apt install rsyslog-elasticsearch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cat > /etc/rsyslog.d/elasticsearch.conf <<EOF
|
|
|
|
|
|
|
|
module(load="omelasticsearch")
|
|
|
|
|
|
|
|
template(name="rsyslog"
|
|
|
|
|
|
|
|
type="list"
|
|
|
|
|
|
|
|
option.json="on") {
|
|
|
|
|
|
|
|
constant(value="{")
|
|
|
|
|
|
|
|
constant(value="\"timestamp\":\"") property(name="timereported" dateFormat="rfc3339")
|
|
|
|
|
|
|
|
constant(value="\",\"message\":\"") property(name="msg")
|
|
|
|
|
|
|
|
constant(value="\",\"host\":\"") property(name="hostname")
|
|
|
|
|
|
|
|
constant(value="\",\"severity\":\"") property(name="syslogseverity-text")
|
|
|
|
|
|
|
|
constant(value="\",\"facility\":\"") property(name="syslogfacility-text")
|
|
|
|
|
|
|
|
constant(value="\",\"syslogtag\":\"") property(name="syslogtag")
|
|
|
|
|
|
|
|
constant(value="\"}")
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
action(type="omelasticsearch"
|
|
|
|
|
|
|
|
server="10.22.22.124"
|
|
|
|
|
|
|
|
serverport="9200"
|
|
|
|
|
|
|
|
template="rsyslog"
|
|
|
|
|
|
|
|
searchIndex="rsyslog-index"
|
|
|
|
|
|
|
|
searchType="rsyslog-type"
|
|
|
|
|
|
|
|
bulkmode="on"
|
|
|
|
|
|
|
|
maxbytes="100m"
|
|
|
|
|
|
|
|
queue.type="linkedlist"
|
|
|
|
|
|
|
|
queue.size="5000"
|
|
|
|
|
|
|
|
queue.dequeuebatchsize="300"
|
|
|
|
|
|
|
|
action.resumeretrycount="-1")
|
|
|
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
systemctl restart rsyslog
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|