Restful URL access log reports


Hi I'm new to splunk. I have an web access log that I want to pull usage information from. Now the URLs are restful web service urls, so the url path is different for each service bing called. Also the name of the user calling the service is included in the path. like this:

So my question is how can I get splunk to report on the number of services being accessed, wich users are accessing what services and how often. Basically I guess I am asking how can I report on the data parsed from the URL.



I did it using rex in sed mode. Suppose you have an index with some paths having URIs such as /service/devices/5302AFDCE0EA/operation, e.g. of access logs containing: - - [26/Sep/2014:18:01:07 +0200] "GET /service/devices/5302AFDCE0EA/operation HTTP/1.1" 200 112719 7085350

You can use rex to collapse all the URIs containing a unique device ID into a URI value /service/devices/${deviceId}/operation like this:

 index="web-logs" earliest=-30m latest=now | rex field=uri mode=sed "s/\/devices\/\\w+\//\/devices\/${deviceId}\//g"

Now you can group events by uri and you won't have a long tail of unique values clumped under "OTHER". You can chain multiple | rex ... commands to your SPL to process more URI patterns.

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...