Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Extract a Part of a URL with extract text processor

avatar
Contributor

Hy everyone, 

I need help to extract a part from a url with the extratct text processor.

 

/organisations/60910c2f18572ebe8aa7a677/detailedLaborcosts? (Note the ID may change)

I expect this result 60910c2f18572ebe8aa7a677

 

Thanks for suggestions

2 ACCEPTED SOLUTIONS

avatar
Super Guru

Hi ,

Do you usually have the ID sorrounded with the same phrases all the time? like this:

/organisations/ID/detailedLaborcosts

If that is the case you can use the following regex in the extract text processor:

/organisations/([0-9a-z]+)/detailedLaborcosts

Hope that helps.

 

 

 

 

View solution in original post

avatar
Contributor

I have found the solution, for the changing parts of the url

https://mycompany\.my\.app/api/public/v1/organisations/([0-9a-z]+)/detailedLaborcosts.*

View solution in original post

3 REPLIES 3

avatar
Super Guru

Hi ,

Do you usually have the ID sorrounded with the same phrases all the time? like this:

/organisations/ID/detailedLaborcosts

If that is the case you can use the following regex in the extract text processor:

/organisations/([0-9a-z]+)/detailedLaborcosts

Hope that helps.

 

 

 

 

avatar
Contributor

Hi, thanks for your help.

Unfortunately it does not work, here is the entire URL I have also defined variables that are part of the URL. I had not considered that these must be taken into account

https://mycompany.my.app/api/public/v1/organisations/60910c2f18572ebe8aa7a677/detailedLaborcosts?month=#{today}&apiKey=myapikey
The components highlighted in red may change, the rest is constant

avatar
Contributor

I have found the solution, for the changing parts of the url

https://mycompany\.my\.app/api/public/v1/organisations/([0-9a-z]+)/detailedLaborcosts.*