mustafa | d5d20b3 | 2021-04-07 15:06:59 -0500 | [diff] [blame] | 1 | # 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 Boyer | 39b9c42 | 2021-08-26 15:17:41 -0500 | [diff] [blame^] | 11 | # Limit to no more than 4000 entries in one minute and enable the |
mustafa | d5d20b3 | 2021-04-07 15:06:59 -0500 | [diff] [blame] | 12 | # journal workaround to avoid duplicate entries |
| 13 | module(load="imjournal" StateFile="/var/log/state" |
| 14 | RateLimit.Interval="60" |
Charles Boyer | 39b9c42 | 2021-08-26 15:17:41 -0500 | [diff] [blame^] | 15 | RateLimit.Burst="4000") |
mustafa | d5d20b3 | 2021-04-07 15:06:59 -0500 | [diff] [blame] | 16 | |
| 17 | # Template for IPMI SEL messages |
| 18 | # "<timestamp> <ID>,<Type>,<EventData>,[<Generator ID>,<Path>,<Direction>]" |
| 19 | template(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>" |
| 38 | template(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>" |
| 49 | template(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. |
| 62 | if ($!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 |
| 67 | if ($!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 |
| 72 | if ($!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 |