- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Disclaimer : I'm new to Regex and using the Rex function
I have a field "Message" that has the following string format:
"EWT_Print=282, CIQ=1, Did not meet the threshold, 009s5td"
All the Message field values are going to have the same format "EWT_Print=[some number], CIQ=[some number], some text"
I am trying to extract the value of the EWT_Print, in this example 282 and display it in a table, however, I always get an empty table when I try this:
<my base search> | rex field=Message "EWT_Print=(?<EWT>[0-9]+)*"
What am I doing wrong?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Try:
... [ your search ] ...
| rex "EWT_Print=(?<EWT>[^,]+),"
If that works, then try:
... [ your search ] ...
| rex field=Message "EWT_Print=(?<EWT>[^,]+),"
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@wicke_s - Try this regex. (make sure field Message is not containing "(quote) in value.)
^EWT_Print=(?<EWT_Printer>\d+),
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
<base search> | rex field=Message "EWT_Print\=(?P<EWT>\d+)\,"
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi
Try this,
| makeresults
| eval Message = "EWT_Print=282, CIQ=1, Did not meet the threshold, 009s5td"
| rex field=Message "EWT_Print\=(?P<EWT>[\d]+)"
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Try:
... [ your search ] ...
| rex "EWT_Print=(?<EWT>[^,]+),"
If that works, then try:
... [ your search ] ...
| rex field=Message "EWT_Print=(?<EWT>[^,]+),"
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This did the trick, The ',' is what I was missing.....
<search> | rex "EWT_Print=(?<EWT>[0-9]+),"
is the query that worked for me. Thanks a lot
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Are you searching in verbose mode? Because verbose mode auto extracts key value pairs like these you have.
If not in verbose mode you can use the '| extract' command to achieve the same result.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply! I am searching in verbose mode and I also tried the search with the "extract" keyword. Still returns empty table
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

What's your full search?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
index=<index> sourcetype=<sourcetype> Message="EWT_Print*" | rex field=Extended_Field.Message "EWT_Print=(?<EWT>[0-9]+)"| table EWT
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Try renaming the field first
...
| rename Extended_Field.Message as message
| rex field=message
...
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


Your regex looks good, although the *
is not needed. It works in regex101.com. Have you tried without the *
?
If this reply helps you, Karma would be appreciated.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I got the regex from regex101.com 🙂
I tried without the * and it still doesn't work. I tried without the table and I could see I have at least 133 events matching the search, however the rex still doesn't work.
Thanks for taking the time to look into this!
