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
SplunkTrust
SplunkTrust

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

(?\w{64})

Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...