Hello,
i'd like to detect a part from a message matching a specific sentence .
When the searched part doesn't contain numbers it works fine with this grok filter :
match => ["Message" , "(^|\W+)(?<keyword>parsing failed for header from)(\W+|$)"]
it detects the partial message "parsing failed for header from" correctly.
what shall i add to make it detect a message like this :
" warning: get digits failed, (450) "
(the (^|\W+) doesn't seem to do the task )
Thanks in advance .
match =>{
"message" =>"%{SYSLOGTIMESTAMP:Date}%{SPACE}%{NOTSPACE:Logsource}%{SPACE}%{WORD:Servertype}:%{SPACE}\[%{WORD:PID}]%{SPACE}%{GREEDYDATA:Message}"
}
Jan 21 14:04:40.424 OPCM35AVCS207 VCS: [0x00000fd8] warning: get digits failed, (450) - wrong number of arguments or invalid property assignment testing now
match => ["Message" , "(^|\W+)(?warning: get digits failed, (450) - wrong number of arguments or invalid property assignment)(\W+|$)"]
but it doesn't detect the "warning: get digits failed, (450) - wrong number of arguments or invalid property assignment"
i guess it's due to the "(450)" part.
That is not a valid regexp. You may need to use markdown to prevent the browser consuming some of the characters in the regexp. Make sure it appears correctly in the preview pane on the right when editing your message.
match => ["Message" , "(^|\W+)(?warning: get digits failed, (450) - wrong number of arguments or invalid property assignment)(\W+|$)"]
but that produces the error
#<RegexpError: undefined group option: /(^|\W+)(?warning: get digits failed, (450) - wrong number of arguments or invalid property assignment)(\W+|$)/m>
which suggests to me that you are not actually using the pattern you say you are, possibly because the browser has consumed #, *, or < characters as markdown.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.