All Apps and Add-ons

Extract 65-char string between forward slashes?

pcorchary
Explorer

I've been trying to extract a field 'user_id' from lines like below. The field will always be 65 char long alphanumeric and usually be between forward slashes. (there is one case where it is in single quotes with text before and after.) I dont think there are any other 65-char strings to generate false positives.

This ...

(?P<FIELDNAME>\/[a-z0-9A-Z]{65}\/) 

isn't getting it ... can some REX guru tell me what I'm doing wrong, please? 🙂

Jan 8 08:07:12 storage-bpmpgbhp8xqbr uwsgi_storage: [08/Jan/2014:08:07:12 +0000] [10.0.0.0] [10.0.0.0] [200] [HTTP/1.1] [GET] [11] [881] [/1b1c360a515100881ecc97ed9c9c3767ff0b708925788efded2602514342b7c4/files/] [] [] [curl/7.33.0]
Jan 8 08:07:12 storage-pouwb84yj8ytc uwsgi_storage: [08/Jan/2014:08:07:12 +0000] [10.0.0.0] [10.0.0.0] [404] [HTTP/1.1] [GET] [7] [51] [/9030e295eb8cbcdb0384ee52ab0ac688e2e23c9c95a5ceb6fa1edcc3097d887b/appdata/thumbnail/c8b626e8-15dd-4990-8d4c-d9b99624a9c3?width=64&height=64] [] [] [-]
Jan 8 08:07:11 storage-7fcoekg7uk4wr uwsgi_storage: [08/Jan/2014:08:07:11 +0000] [10.0.0.0] [10.0.0.0] [404] [HTTP/1.1] [GET] [5] [51] [/9030e295eb8cbcdb0384ee52ab0ac688e2e23c9c95a5ceb6fa1edcc3097d887b/appdata/thumbnail/902aeb1c-af8f-42d0-b2e8-9f59c3a051c4?width=64&height=64] [] [] [-]

0 Karma

gfuente
Motivator

Try this reg ex:

\[\/(?<field>\w{64})\/

Regards

MuS
Legend

small update on the regex, this will not include the \/ in the value of field:

(?\w{64})

Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...