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!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...