Splunk Search

extract selected data from given field

Explorer

I've error messages in the filed name "ErrorMessage"; i want to extract only error code using regex expression.
Pls some one help with correct regex.

filed1 field2 filed3 and so on ... ErrorMessage
ANK-BEQ-1014 Dispatcher detected an error4.
ANK-BEQ-1015 Dispatcher detected an error5.
ANK-BEQ-1016 Dispatcher detected an error6.
Logon Error.
System Error.

Expected results Error codes:
ANK-BEQ-1014
ANK-BEQ-1015
ANK-BEQ-1016

Tags (2)
0 Karma
1 Solution

Legend

Try this

yoursearchhere
| rex field=original_field_name "(?<error_code>.*?)\s"

View solution in original post

0 Karma

Legend

Try this

yoursearchhere
| rex field=original_field_name "(?<error_code>.*?)\s"

View solution in original post

0 Karma