blob: b98610635de34b5f469e8a5a6b2137a6a7a481a1 [file] [log] [blame]
mustafad5d20b32021-04-07 15:06:59 -05001# if you experience problems, check
2# http://www.rsyslog.com/troubleshoot for assistance
3
4# rsyslog v3: load input modules
5# If you do not load inputs, nothing happens!
6# You may need to set the module load path if modules are not found.
7#
8# Ported from debian's sysklogd.conf
9
10# Journal-style logging
Charles Boyer39b9c422021-08-26 15:17:41 -050011# Limit to no more than 4000 entries in one minute and enable the
mustafad5d20b32021-04-07 15:06:59 -050012# journal workaround to avoid duplicate entries
13module(load="imjournal" StateFile="/var/log/state"
14 RateLimit.Interval="60"
Charles Boyer39b9c422021-08-26 15:17:41 -050015 RateLimit.Burst="4000")
mustafad5d20b32021-04-07 15:06:59 -050016
17# Template for IPMI SEL messages
18# "<timestamp> <ID>,<Type>,<EventData>,[<Generator ID>,<Path>,<Direction>]"
19template(name="IPMISELTemplate" type="list") {
20 property(name="timereported" dateFormat="rfc3339")
21 constant(value=" ")
22 property(name="$!IPMI_SEL_RECORD_ID")
23 constant(value=",")
24 property(name="$!IPMI_SEL_RECORD_TYPE")
25 constant(value=",")
26 property(name="$!IPMI_SEL_DATA")
27 constant(value=",")
28 property(name="$!IPMI_SEL_GENERATOR_ID")
29 constant(value=",")
30 property(name="$!IPMI_SEL_SENSOR_PATH")
31 constant(value=",")
32 property(name="$!IPMI_SEL_EVENT_DIR")
33 constant(value="\n")
34}
35
36# Template for Redfish messages
37# "<timestamp> <MessageId>,<MessageArgs>"
38template(name="RedfishTemplate" type="list") {
39 property(name="timereported" dateFormat="rfc3339")
40 constant(value=" ")
41 property(name="$!REDFISH_MESSAGE_ID")
42 constant(value=",")
43 property(name="$!REDFISH_MESSAGE_ARGS")
44 constant(value="\n")
45}
46
47# Template for Application Crashes
48# "<timestamp> <MessageId>,<MessageArgs>"
49template(name="CrashTemplate" type="list") {
50 property(name="timereported" dateFormat="rfc3339")
51 constant(value=" ")
52 constant(value="OpenBMC.0.1.ServiceFailure")
53 constant(value=",")
54 property(name="$!UNIT")
55 constant(value="\n")
56}
57
58
59# If the journal entry has the IPMI SEL MESSAGE_ID, save as IPMI SEL
60# The MESSAGE_ID string is generated using journalctl and must match the
61# MESSAGE_ID used in IPMI to correctly find the SEL entries.
62if ($!MESSAGE_ID == "b370836ccf2f4850ac5bee185b77893a") then {
63 action(type="omfile" file="/var/log/ipmi_sel" template="IPMISELTemplate")
64}
65
66# If the journal entry has a Redfish MessageId, save as a Redfish event
67if ($!REDFISH_MESSAGE_ID != "") then {
68 action(type="omfile" file="/var/log/redfish" template="RedfishTemplate")
69}
70
71# If the journal entry has a Exit Code, save as a Redfish event
72if ($!EXIT_STATUS != "" and $!EXIT_STATUS != "0") then {
73 action(type="omfile" file="/var/log/redfish" template="CrashTemplate")
74}
75
76#
77# Include all config files in /etc/rsyslog.d/
78#
79$IncludeConfig /etc/rsyslog.d/*.conf