0

We have a web API hosted on IIS which is used to service a SPA and also used to provide data to IPhone/Android apps.

I want to filter the logs (maybe by user agent) so that i can see only the calls coming from the SPA running within browsers (including browsers on the mobile devices) and not any direct calls from the apps (both the SPA and the apps use the same URLs)

We forward all of our iis logs into splunk for analysis and so we have some really good searching and filtering capabilities. The problem is I'm not sure what to search/filter for.

Damo
  • 3,355
  • 2
  • 23
  • 41

1 Answers1

2

This is not quite as straight forward as you might think.

Essentially you have to identify all mobile clients by their user-agent value. There are many, many mobile user-agents (http://www.useragentstring.com/pages/Mobile%20Browserlist/), so enumerating them all is not efficient.

Using LogParser (see and example here: http://blogs.msdn.com/b/jaskis/archive/2008/11/13/logparser-calculate-no-of-hits-for-different-browser-type-from-iis-logs.aspx) you can create a set of rules to cover the 80% of mobile traffic searching for any user agent string that contains any of the following text:

Android, webOS, iPhone, iPad, iPod, BlackBerry, IEMobile, Opera, Mini

This list was taken from: What is the best way to detect a mobile device in jQuery?

Personally, I would try to get the mobile clients of your API to use a different URL, to make it easy to identify, but obviously this requires a code change.

Community
  • 1
  • 1
Deej
  • 153
  • 1
  • 13