-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrsyslog_templates.conf
82 lines (77 loc) · 2.4 KB
/
rsyslog_templates.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#
# Templates
#
# Some useful templates for shipping
# The role field refers to the machines role.
# Template for shipping syslog rfc5424 messages sent directly to rsyslog.
# Ships in JSON
template(name="syslogTemplate"
type="list") {
constant(value="{ ")
constant(value="\"type\":\"syslog\", ")
constant(value="\"host\":\"")
property(name="hostname")
constant(value="\", ")
constant(value="\"timestamp\":\"")
property(name="timestamp" dateFormat="rfc3339")
constant(value="\", ")
constant(value="\"@version\":\"1\", ")
constant(value="\"role\":\"awesome_app\", ")
constant(value="\"message\":\"")
property(name="msg" format="json")
constant(value="\", ")
constant(value="\"priority\":\"")
property(name="syslogseverity")
constant(value="\", ")
constant(value="\"program\":\"")
property(name="programname")
constant(value="\", ")
constant(value="\"facility\":\"")
property(name="syslogfacility-text")
constant(value="\", ")
constant(value="\"severity\":\"")
property(name="syslogseverity-text")
constant(value="\"}\n")
}
# Template for shipping JSON logs
# Just adds some furniture to the json message
template(name="jsonLogTemplate"
type="list") {
constant(value="{ ")
constant(value="\"type\":\"")
property(name="programname")
constant(value="\", ")
constant(value="\"host\":\"")
property(name="hostname")
constant(value="\", ")
constant(value="\"@version\":\"1\", ")
constant(value="\"role\":\"awesome_app\", ")
constant(value="\"sourcefile\":\"")
property(name="$!metadata!filename")
constant(value="\", ")
property(name="msg" position.from="2")
constant(value="\n")
}
# Template for non json logs, just sends the message wholesale with extra
# furniture.
template(name="textLogTemplate"
type="list") {
constant(value="{ ")
constant(value="\"type\":\"")
property(name="programname")
constant(value="\", ")
constant(value="\"host\":\"")
property(name="hostname")
constant(value="\", ")
constant(value="\"timestamp\":\"")
property(name="timestamp" dateFormat="rfc3339")
constant(value="\", ")
constant(value="\"@version\":\"1\", ")
constant(value="\"role\":\"awesome_app\", ")
constant(value="\"sourcefile\":\"")
property(name="$!metadata!filename")
constant(value="\", ")
constant(value="\"message\":\"")
property(name="rawmsg" format="json")
constant(value="\"}\n")
}