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})

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

How Edge Processor's Durable Queue Works

Edge Processor sits in one of the most consequential places in any Splunk pipeline: between your data sources ...

Quantify Your Splunk Investment Impact: Introducing Savings Metrics to Value Insights

Building on the foundation established in our initial Value Insights releases, we are introducing the Savings ...