All Apps and Add-ons

Change search results for page counts

JohannesGmelin
Path Finder

Hey Community,

I need help with a custom search. At the moment I get a result looks like this:

/AuthorizationAdmin/javax.faces.resource/calendar.js.xhtml?ln=org.richfaces

But I need just the first word after the first slash without the other trash just like this:

/AuthorizationAdmin/

This is my search:

| tstats summariesonly=t count FROM datamodel=Web WHERE Web.site="*" "Web.eventtype"=pageview GROUPBY Web.uri | eventstats sum(count) as Total | eval percent = round((count/Total)*100,2) . "%" | fields - Total | rename percent AS "% Pageviews"

Thanks for your help!!!

0 Karma
1 Solution

woodcock
Esteemed Legend

Like this:

| tstats summariesonly=t count FROM datamodel=Web WHERE Web.site="*" "Web.eventtype"=pageview GROUPBY Web.uri
| eventstats sum(count) as Total
| eval percent = round((count/Total)*100,2) . "%"
| fields - Total
| rename percent AS "% Pageviews"
| rex field=Web.uri mode=sed "s/^(\/[^\/]+\/).*$/\1/"

View solution in original post

woodcock
Esteemed Legend

Like this:

| tstats summariesonly=t count FROM datamodel=Web WHERE Web.site="*" "Web.eventtype"=pageview GROUPBY Web.uri
| eventstats sum(count) as Total
| eval percent = round((count/Total)*100,2) . "%"
| fields - Total
| rename percent AS "% Pageviews"
| rex field=Web.uri mode=sed "s/^(\/[^\/]+\/).*$/\1/"

JohannesGmelin
Path Finder

Great thank you! 🙂

I've tried this at the User User Journey Flow too (Landing Page) but no result 😕

Do you have any idea why?
The other problem is that I'm getting now 10 times a page for example like this: /admin/
because the ending is different but it should be just one entry for one page you understand?

Thanks a lot!

LG Johannes

0 Karma

woodcock
Esteemed Legend

Try this search: does it do what you expect?

| makeresults 
| eval Web.uri="/first/second/third/fourth" 
| rex field=Web.uri mode=sed "s/^(\/[^\/]+\/).*$/\1/"
0 Karma

JohannesGmelin
Path Finder

I've sent you an email with a picture for a better understanding. I'm not allowed to make this picture public 😕

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...