nais-log-parser 0.34.1 → 0.34.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4932c0f7224bf9f7c62f85daefbf6b68d9bf4040
4
- data.tar.gz: c213153f665eca1167341833a3d36d9cc7436717
3
+ metadata.gz: a9cf33b6b0246ee200cf85ad7173869ddff1df68
4
+ data.tar.gz: c9bcba0ece4a8aeafa9db035e9589d9bd3ce008b
5
5
  SHA512:
6
- metadata.gz: 9c1c42b758bbbb14d0ca265e0471222f8d57eba90757ba811a9b16819a2f9d701b128508df03466ca8c207dd353893f55c3851deae7885ed4303a8d953c5b7c6
7
- data.tar.gz: ed087b73a132758c1917b7ad9a475b4d2117148f2966e84bd3e243006e3cce8d5b6ce04f8d3f82959dcab1db6768e7815aad76172aa49d66f7290ce3cb425edd
6
+ metadata.gz: 615784e00ebe232685988109427648f4adb378149bd535fae1e526300f1015e94d658e586c6558eb7e6f780326e248d36e783e1d51a07353ba091d80e79d2537
7
+ data.tar.gz: b0b6ff62ef78a138d60992d8b8bfabd2fca8ac4e14b72834ab2af98b15aeef95143f4e04faa120e68c2593b9ba842177551447290cf74157f5c5fc655fd3b15d
@@ -1,7 +1,7 @@
1
1
  module Nais
2
2
  module Log
3
3
  module Parser
4
- VERSION = "0.34.1"
4
+ VERSION = "0.34.2"
5
5
  end
6
6
  end
7
7
  end
@@ -67,57 +67,59 @@ module Nais
67
67
  when '0'
68
68
  'Emergency'
69
69
  end
70
- record['facility'] = case record['syslog_facility']
71
- when '23'
72
- 'local7'
73
- when '22'
74
- 'local6'
75
- when '21'
76
- 'local5'
77
- when '20'
78
- 'local4'
79
- when '19'
80
- 'local3'
81
- when '18'
82
- 'local2'
83
- when '17'
84
- 'local1'
85
- when '16'
86
- 'local0'
87
- when '15'
88
- 'cron'
89
- when '14'
90
- 'logalert'
91
- when '13'
92
- 'logaudit'
93
- when '12'
94
- 'ntp'
95
- when '11'
96
- 'ftp'
97
- when '10'
98
- 'authpriv'
99
- when '9'
100
- 'clock'
101
- when '8'
102
- 'uucp'
103
- when '7'
104
- 'news'
105
- when '6'
106
- 'lpr'
107
- when '5'
108
- 'syslog'
109
- when '4'
110
- 'auth'
111
- when '3'
112
- 'daemon'
113
- when ''
114
- 'mail'
115
- when '1'
116
- 'user'
117
- when '0'
118
- 'kern'
119
- end
120
- record.delete('syslog_facility')
70
+ if record.has_key?('syslog_facility')
71
+ record['facility'] = case record['syslog_facility']
72
+ when '23'
73
+ 'local7'
74
+ when '22'
75
+ 'local6'
76
+ when '21'
77
+ 'local5'
78
+ when '20'
79
+ 'local4'
80
+ when '19'
81
+ 'local3'
82
+ when '18'
83
+ 'local2'
84
+ when '17'
85
+ 'local1'
86
+ when '16'
87
+ 'local0'
88
+ when '15'
89
+ 'cron'
90
+ when '14'
91
+ 'logalert'
92
+ when '13'
93
+ 'logaudit'
94
+ when '12'
95
+ 'ntp'
96
+ when '11'
97
+ 'ftp'
98
+ when '10'
99
+ 'authpriv'
100
+ when '9'
101
+ 'clock'
102
+ when '8'
103
+ 'uucp'
104
+ when '7'
105
+ 'news'
106
+ when '6'
107
+ 'lpr'
108
+ when '5'
109
+ 'syslog'
110
+ when '4'
111
+ 'auth'
112
+ when '3'
113
+ 'daemon'
114
+ when ''
115
+ 'mail'
116
+ when '1'
117
+ 'user'
118
+ when '0'
119
+ 'kern'
120
+ end
121
+ record.delete('syslog_facility')
122
+ end
121
123
  record.delete('syslog_pid')
122
124
  record.delete('syslog_timestamp')
123
125
  record.delete('syslog_raw')
@@ -139,12 +141,15 @@ module Nais
139
141
  record['command'] = record.delete('comm')
140
142
  record.delete('exe')
141
143
  # keep record['cmdline']
144
+ # keep record['interface']
142
145
  record.delete('systemd_cgroup')
143
146
  record.delete('systemd_unit')
144
147
  record.delete('systemd_invocation_id')
145
148
  # keep record['message']
146
149
  if record.has_key?('source_realtime_timestamp')
147
150
  record['@timestamp'] = record.delete('source_realtime_timestamp')
151
+ elsif record.has_key?('source_monotonic_timestamp')
152
+ record['@timestamp'] = record.delete('source_monotonic_timestamp')
148
153
  end
149
154
  record
150
155
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nais-log-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.1
4
+ version: 0.34.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Terje Sannum