Skip to content

Commit 2ee48ff

Browse files
flysenjsvd
authored andcommitted
Added SYSLOG5424LINE and test ipv4/ipv6/hostname as syslog5424_host rfc5424
Fixes #184
1 parent 0c9b956 commit 2ee48ff

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

spec/patterns/syslog_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44

55
describe "SYSLOGLINE" do
66

7+
describe "SYSLOG5424BASE" do
8+
it "matches host names in the syslog base pattern" do
9+
expect(subject).to match("<174>1 2016-11-14T09:32:44+01:00 resolver.se named 6344 - - info: client 10.23.53.22#63252: query: googlehosted.l.googleusercontent.com IN A + (10.23.16.6)")
10+
end
11+
12+
it "matches ipv4 in the syslog base pattern" do
13+
expect(subject).to match("<174>1 2016-11-14T09:49:23+01:00 10.23.16.6 named 2255 - - info: client 10.23.56.93#63295 (i1.tmg.com): query: i1.tmg.com IN A + (10.23.4.13)")
14+
end
15+
16+
it "matches ipv6 in the syslog base pattern" do
17+
expect(subject).to match("<174>1 2016-11-14T09:49:23+01:00 2000:6a0:b:315:10:23:4:13 named 2255 - - info: client 10.23.56.9#63295 (i1.tmg.com): query: i1.tmg.com IN A + (10.23.4.13)")
18+
end
19+
end
20+
721
it "matches a simple message with pid" do
822
expect(subject).to match("May 11 15:17:02 meow.soy.se CRON[10973]: pam_unix(cron:session): session opened for user root by (uid=0)")
923
end

0 commit comments

Comments
 (0)