Getting Data In

Need help on Rex Please: How to extract the below events?

kc_prane
Path Finder

Hi, I need  to extract the below events i tried this  | rex "URI\s(?<URI>.+?)="   but not working. i want to extract for the 1& 2 events before the "="

URI /api/Hellothisistest?customerNumber=244479
URI /api/Hellothisistest?customerNumber=247370
URI  /api/Getthisextractessample
URI  /api/createthisextractesof
URI  /api/liverpooltestsoccer

 

Thanks in Advance

 

Labels (1)
Tags (2)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @kc_prane,

good for you, see next time!

let me know if I can help you more, or, please, accept one answer for the other people of Community.

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

View solution in original post

kc_prane
Path Finder

Thanks @gcusello  modifed your query and helped  | rex "URI\s*(?<URI>[^\=\n]+)"  worked for me

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @kc_prane,

good for you, see next time!

let me know if I can help you more, or, please, accept one answer for the other people of Community.

Ciao and happy splunking

Giuseppe

P.S.: Karma Points are appreciated 😉

gcusello
SplunkTrust
SplunkTrust

Hi @kc_prane,

you can use this if you want to take all after URI:

 

| rex "URI\s*(?<URI>.+)=*"

 

if instead you want the URL until "=" when present, you can use the following regex:

 

| rex "URI\s*(?<URI>[^\=\n]+)(=*)|\n"

 

you can test this regex at https://regex101.com/r/jZY2kz/1

ciao.

Giuseppe

Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 2 releases of new security content via the ...

Announcing the 1st Round Champion’s Tribute Winners of the Great Resilience Quest

We are happy to announce the 20 lucky questers who are selected to be the first round of Champion's Tribute ...

We’ve Got Education Validation!

Are you feeling it? All the career-boosting benefits of up-skilling with Splunk? It’s not just a feeling, it's ...