- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

jacqu3sy
Path Finder
04-01-2020
07:43 AM
Hi,
How do I write a regex to capture whenever I see any combination of 10 digits followed by .zip within a _raw event?
eg:
url=www.abcdef.com/1234532419.zip
Thanks.
1 Solution
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

vnravikumar
Champion
04-01-2020
08:12 AM
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

woodcock
Esteemed Legend
04-01-2020
01:01 PM
Like this:
... | rex field=url mode=sed "s/\.zip//"
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

vnravikumar
Champion
04-01-2020
08:12 AM
Try like
| rex field=url "\/(?P<result>\d{10}.zip)"
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

jacqu3sy
Path Finder
04-01-2020
08:53 AM
ah yeh, how would I capture the whole URL though in the new result field? rather than just the 6 digits?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

vnravikumar
Champion
04-01-2020
09:02 AM
what is your expected result?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

jacqu3sy
Path Finder
04-01-2020
09:11 AM
Expected result is the full URL listed, but to only pull back URL's that match the regex, i.e. 10 digits followed by .zip
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

vnravikumar
Champion
04-01-2020
09:17 AM
Check this rex (?P<result>url=\S+\/\d{10}.zip)
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

jacqu3sy
Path Finder
04-01-2020
10:23 AM
Perfect. Many thanks 🙂
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

kamlesh_vaghela

SplunkTrust
04-01-2020
07:48 AM
@jacqu3sy
Try this:
YOUR SEARCH | rex field=url "(?<data>\d.*).zip"
Sample
|makeresults | eval url="www.abcdef.com/1234532419.zip" | rex field=url "(?<data>\d.*).zip"
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

jacqu3sy
Path Finder
04-01-2020
08:53 AM
ah yeh, how would I capture the whole URL though in the new data field? rather than just the 6 digits?
