mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Merge pull request #569 from hltbra/master
Add "emergency" to `LOGLEVEL` grok pattern
This commit is contained in:
commit
321ec3b9ec
2 changed files with 29 additions and 1 deletions
|
@ -92,4 +92,4 @@ SYSLOGBASE %{SYSLOGTIMESTAMP:timestamp} (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logs
|
|||
COMBINEDAPACHELOG %{IPORHOST:clientip} %{USER:ident} %{USER:auth} \[%{HTTPDATE:timestamp}\] "(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" %{NUMBER:response} (?:%{NUMBER:bytes}|-) %{QS:referrer} %{QS:agent}
|
||||
|
||||
# Log Levels
|
||||
LOGLEVEL ([T|t]race|TRACE|[D|d]ebug|DEBUG|[N|n]otice|NOTICE|[I|i]nfo|INFO|[W|w]arn?(?:ing)?|WARN?(?:ING)?|[E|e]rr?(?:or)?|ERR?(?:OR)?|[C|c]rit?(?:ical)?|CRIT?(?:ICAL)?|[F|f]atal|FATAL|[S|s]evere|SEVERE)
|
||||
LOGLEVEL ([T|t]race|TRACE|[D|d]ebug|DEBUG|[N|n]otice|NOTICE|[I|i]nfo|INFO|[W|w]arn?(?:ing)?|WARN?(?:ING)?|[E|e]rr?(?:or)?|ERR?(?:OR)?|[C|c]rit?(?:ical)?|CRIT?(?:ICAL)?|[F|f]atal|FATAL|[S|s]evere|SEVERE|EMERG(?:ENCY)?|[Ee]merg(?:ency)?)
|
||||
|
|
|
@ -263,6 +263,34 @@ describe LogStash::Filters::Grok do
|
|||
end
|
||||
end
|
||||
|
||||
describe "grok on %{LOGLEVEL}" do
|
||||
config <<-'CONFIG'
|
||||
filter {
|
||||
grok {
|
||||
pattern => "%{LOGLEVEL:level}: error!"
|
||||
}
|
||||
}
|
||||
CONFIG
|
||||
|
||||
log_level_names = %w(
|
||||
trace Trace TRACE
|
||||
debug Debug DEBUG
|
||||
notice Notice Notice
|
||||
info Info INFO
|
||||
warn warning Warn Warning WARN WARNING
|
||||
err error Err Error ERR ERROR
|
||||
crit critical Crit Critical CRIT CRITICAL
|
||||
fatal Fatal FATAL
|
||||
severe Severe SEVERE
|
||||
emerg emergency Emerg Emergency EMERG EMERGENCY
|
||||
)
|
||||
log_level_names.each do |level_name|
|
||||
sample "#{level_name}: error!" do
|
||||
insist { subject['level'] } == level_name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "tagging on failure" do
|
||||
config <<-CONFIG
|
||||
filter {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue