File tree 8 files changed +54
-5
lines changed
8 files changed +54
-5
lines changed Original file line number Diff line number Diff line change
1
+ ## 4.2.0
2
+ - Fix: Java stack trace's JAVAFILE to better match generated names
3
+ - Fix: match Information/INFORMATION in LOGLEVEL [ #274 ] ( https://github.com/logstash-plugins/logstash-patterns-core/pull/274 )
4
+ - Fix: NAGIOS TIMEPERIOD unknown (from/to) field matching [ #275 ] ( https://github.com/logstash-plugins/logstash-patterns-core/pull/275 )
5
+
1
6
## 4.1.2
2
7
- Fix some documentation issues
3
8
Original file line number Diff line number Diff line change 1
1
Gem ::Specification . new do |s |
2
2
3
3
s . name = 'logstash-patterns-core'
4
- s . version = '4.1.2 '
4
+ s . version = '4.2.0 '
5
5
s . licenses = [ 'Apache License (2.0)' ]
6
6
s . summary = "Patterns to be used in logstash"
7
7
s . description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
Original file line number Diff line number Diff line change @@ -92,4 +92,4 @@ QS %{QUOTEDSTRING}
92
92
SYSLOGBASE %{SYSLOGTIMESTAMP:timestamp} (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{SYSLOGPROG}:
93
93
94
94
# Log Levels
95
- LOGLEVEL ([Aa]lert|ALERT|[Tt]race|TRACE|[Dd]ebug|DEBUG|[Nn]otice|NOTICE|[Ii]nfo|INFO|[Ww]arn?(?:ing)?|WARN?(?:ING)?|[Ee]rr?(?:or)?|ERR?(?:OR)?|[Cc]rit?(?:ical)?|CRIT?(?:ICAL)?|[Ff]atal|FATAL|[Ss]evere|SEVERE|EMERG(?:ENCY)?|[Ee]merg(?:ency)?)
95
+ LOGLEVEL ([Aa]lert|ALERT|[Tt]race|TRACE|[Dd]ebug|DEBUG|[Nn]otice|NOTICE|[Ii]nfo?(?:rmation)? |INFO?(?:RMATION)? |[Ww]arn?(?:ing)?|WARN?(?:ING)?|[Ee]rr?(?:or)?|ERR?(?:OR)?|[Cc]rit?(?:ical)?|CRIT?(?:ICAL)?|[Ff]atal|FATAL|[Ss]evere|SEVERE|EMERG(?:ENCY)?|[Ee]merg(?:ency)?)
Original file line number Diff line number Diff line change 1
1
JAVACLASS (?:[a-zA-Z$_][a-zA-Z$_0-9]*\.)*[a-zA-Z$_][a-zA-Z$_0-9]*
2
2
#Space is an allowed character to match special cases like 'Native Method' or 'Unknown Source'
3
- JAVAFILE (?:[A-Za-z0-9_ . -]+)
3
+ JAVAFILE (?:[a-zA-Z$_0-9 . -]+)
4
4
#Allow special <init>, <clinit> methods
5
5
JAVAMETHOD (?:(<(?:cl)?init>)|[a-zA-Z$_][a-zA-Z$_0-9]*)
6
6
#Line number is optional in special cases 'Native method' or 'Unknown source'
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ NAGIOS_PASSIVE_HOST_CHECK %{NAGIOS_TYPE_PASSIVE_HOST_CHECK:nagios_type}: %{DATA:
89
89
NAGIOS_SERVICE_EVENT_HANDLER %{NAGIOS_TYPE_SERVICE_EVENT_HANDLER:nagios_type}: %{DATA:nagios_hostname};%{DATA:nagios_service};%{DATA:nagios_state};%{DATA:nagios_statelevel};%{DATA:nagios_event_handler_name}
90
90
NAGIOS_HOST_EVENT_HANDLER %{NAGIOS_TYPE_HOST_EVENT_HANDLER:nagios_type}: %{DATA:nagios_hostname};%{DATA:nagios_state};%{DATA:nagios_statelevel};%{DATA:nagios_event_handler_name}
91
91
92
- NAGIOS_TIMEPERIOD_TRANSITION %{NAGIOS_TYPE_TIMEPERIOD_TRANSITION:nagios_type}: %{DATA:nagios_service};%{DATA :nagios_unknown1};%{DATA :nagios_unknown2}
92
+ NAGIOS_TIMEPERIOD_TRANSITION %{NAGIOS_TYPE_TIMEPERIOD_TRANSITION:nagios_type}: %{DATA:nagios_service};%{NUMBER :nagios_unknown1};%{NUMBER :nagios_unknown2}
93
93
94
94
####################
95
95
#### External checks
Original file line number Diff line number Diff line change 63
63
end
64
64
end
65
65
66
+ describe 'LOGLEVEL' do
67
+ it 'matches info label' do
68
+ expect ( grok_match ( subject , 'INFO' ) ) . to pass
69
+ expect ( grok_match ( subject , 'info' ) ) . to pass
70
+ end
71
+
72
+ it 'matches information label' do
73
+ expect ( grok_match ( subject , 'information' ) ) . to pass
74
+ expect ( grok_match ( subject , 'Information' ) ) . to pass
75
+ expect ( grok_match ( subject , 'INFORMATION' ) ) . to pass
76
+ end
77
+ end
78
+
66
79
describe "IPORHOST" do
67
80
68
81
let ( :pattern ) { "IPORHOST" }
Original file line number Diff line number Diff line change 16
16
end
17
17
end
18
18
end
19
+
20
+ describe "JAVASTACKTRACEPART" do
21
+ let ( :pattern ) { 'JAVASTACKTRACEPART' }
22
+ let ( :message ) { ' at com.sample.stacktrace.StackTraceExample.aMethod(StackTraceExample.java:42)' }
23
+ it "matches" do
24
+ grok = grok_match ( pattern , message , true )
25
+ expect ( grok ) . to include ( {
26
+ "message" => " at com.sample.stacktrace.StackTraceExample.aMethod(StackTraceExample.java:42)" ,
27
+ "method" => "aMethod" ,
28
+ "class" => "com.sample.stacktrace.StackTraceExample" ,
29
+ "file" => "StackTraceExample.java" ,
30
+ "line" => "42"
31
+ } )
32
+ end
33
+
34
+ context 'generated file' do
35
+ let ( :message ) { ' at org.jruby.RubyMethod$INVOKER$i$call.call(RubyMethod$INVOKER$i$call.gen)' }
36
+ it "matches" do
37
+ grok = grok_match ( pattern , message , true )
38
+ expect ( grok ) . to include ( {
39
+ "method" => "call" ,
40
+ "class" => "org.jruby.RubyMethod$INVOKER$i$call" ,
41
+ "file" => "RubyMethod$INVOKER$i$call.gen" ,
42
+ } )
43
+ end
44
+ end
45
+ end
Original file line number Diff line number Diff line change 82
82
83
83
describe "NAGIOSLOGLINE - TIMEPERIOD TRANSITION" do
84
84
85
- let ( :value ) { "[1427925600] TIMEPERIOD TRANSITION: 24X7;1;1" }
85
+ let ( :value ) { "[1427925600] TIMEPERIOD TRANSITION: 24X7;- 1;1" }
86
86
let ( :grok ) { grok_match ( subject , value ) }
87
87
88
88
it "a pattern pass the grok expression" do
105
105
expect ( grok ) . to include ( "nagios_service" => "24X7" )
106
106
end
107
107
108
+ it "generates the period from/to fields" do
109
+ expect ( grok ) . to include ( "nagios_unknown1" => "-1" , "nagios_unknown2" => "1" )
110
+ end
111
+
108
112
# Regression test for but fixed in Nagios patterns #30
109
113
it "doesn't end in a semi-colon" do
110
114
expect ( grok [ 'message' ] ) . to_not end_with ( ";" )
You can’t perform that action at this time.
0 commit comments