syslogstash 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/syslogstash/syslog_reader.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edd5226a95758de105e45a323f57e7ba13d986280949a27cc56c480ce8ad7b60
|
4
|
+
data.tar.gz: 61956dc95485ff4840c0fdb395535ab0d0f32360432a42b465e601d766e0b9db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6d5d941eaafe7b6d786f6090a8a90eea0a6260d9109bb5ef6dc5e1c9f3c9686f7a154b08b94af3b2e11360e7d191ee1436071257bcb3bbe7c5f409ee4c90398
|
7
|
+
data.tar.gz: 0a5a3dec776187dce02e4d96d3cead80cdad851c2eae19a6eb1bed1b90ceb11eb0b607be450bb593270fa749250d685d71e0ebc46c6c837a9125c4fda9ab0fa6
|
@@ -69,7 +69,7 @@ class Syslogstash::SyslogReader
|
|
69
69
|
attr_reader :config, :logger
|
70
70
|
|
71
71
|
def process_message(msg)
|
72
|
-
if msg =~
|
72
|
+
if msg =~ /\A<(\d+)>(\w{3} [ 0-9]{2} [0-9:]{8}) (.*)\z/m
|
73
73
|
flags = $1.to_i
|
74
74
|
timestamp = $2
|
75
75
|
content = $3
|
@@ -77,13 +77,13 @@ class Syslogstash::SyslogReader
|
|
77
77
|
# Lo! the many ways that syslog messages can be formatted
|
78
78
|
hostname, program, pid, message = case content
|
79
79
|
# the gold standard: hostname, program name with optional PID
|
80
|
-
when
|
80
|
+
when /\A([a-zA-Z0-9._-]*[^:]) (\S+?)(\[(\d+)\])?: (.*)\z/m
|
81
81
|
[$1, $2, $4, $5]
|
82
82
|
# hostname, no program name
|
83
|
-
when
|
83
|
+
when /\A([a-zA-Z0-9._-]+) (\S+[^:] .*)\z/m
|
84
84
|
[$1, nil, nil, $2]
|
85
85
|
# program name, no hostname (yeah, you heard me, non-RFC compliant!)
|
86
|
-
when
|
86
|
+
when /\A(\S+?)(\[(\d+)\])?: (.*)\z/m
|
87
87
|
[nil, $1, $3, $4]
|
88
88
|
else
|
89
89
|
# I have NFI
|