Feature: add rsyslog multiline logs

This commit is contained in:
2017-05-24 14:59:12 +02:00
parent 104cecde72
commit 84dbfe7dba
6 changed files with 68 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
template(name="ls_json"
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="\",\"programname\":\"") property(name="programname")
constant(value="\",\"procid\":\"") property(name="procid")
constant(value="\"}")
}

View File

@@ -0,0 +1,9 @@
module(load="imfile" PollingInterval="10" mode="inotify") #needs to be done just once
input(type="imfile"
File="/var/log/java/*.log"
Tag="javalog"
PersistStateInterval="100"
Severity="info"
startmsg.regex="^[[:digit:]]{1,2}-[[:digit:]]{1,2}-[[:digit:]]{1,4} [[:digit:]]{1,2}:[[:digit:]]{1,2}:[[:digit:]]{1,2}"
)

3
rsyslog/rsyslog.conf Normal file
View File

@@ -0,0 +1,3 @@
$IncludeConfig /etc/rsyslog-confd/*.conf
*.* @shipper:10514;ls_json