TIPS & TRICKS

Mobile Analytics (iOS) with Splunk and Storm (Part 2)

In the previous article “Mobile Analytics (iOS) with Storm” , we discussed about sending stacktrace of uncaught exceptions from apps that run on iOS platform into Storm with the STORM REST API. We hope that the article covers the basic steps to help iOS app developers to jumpstart into realizing the potential of making use of Splunk and Storm to help the developers to develop better quality apps.

Great news … iOS developers are now able to send the above-mentioned stacktrace via TCP into both Splunk Enterprise and Storm; and it is very simple to configure this library into iOS app. The breakdown of the steps are as described below:

CREATE A STORM ACCOUNT
[1] Create a Splunk Storm account by registering yourself here: https://www.splunkstorm.com

DOWNLOAD AND CONFIGURE THE LIBRARY
[1] Then download the logging library from http://splunk-base.splunk.com/apps/92296/mobile-analytics-with-splunk-storm-ios or  https://github.com/nicholaskeytholeong/splunk-storm-mobile-analytics/blob/master/ios/splunkmobileanalytics.zip

[2] Unzip it and drag the splunkmobileanalytics folder into the project.

[3] Select Relative to Project at Reference Type, then click Add.


[4] In the AppDelegate interface file (AppDelegate.h), import Storm.h, like so:

#import
...
#import "Storm.h"
// other awesome codes that you are writing

[5] In the AppDelegate implementation file (AppDelegate.m), provide the stormTCPHost and stormTCPPort values in the TCPHost message

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    // Set the view controller as the window's root view controller and display.
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];

    [Storm TCPHost:@"YOUR_STORM_TCP_HOST" TCPPortNum:YOUR_STORM_TCP_PORT];

    return YES;
}

[6] You are set and Splunk Storm is now integrated seamlessly into your iOS mobile app!

BONUS SECTION
[1] Splunk Enterprise was briefly mentioned earlier in this article and many of you might be asking “Would this library send data to Splunk Enterprise via TCP?” Yes! And the configuration steps are very similar except that we are importing the “Splunk.h” header file. An example is as follow:

[2] In the AppDelegate interface file (AppDelegate.h), import Splunk.h, like so:

#import
...
#import "Splunk.h"
// other awesome codes that you are writing

[3] In the AppDelegate implementation file (AppDelegate.m), provide the splunkTCPHost and splunkTCPPort values in the TCPHost message

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    // Set the view controller as the window's root view controller and display.
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];

    [Splunk TCPHost:@"YOUR_SPLUNK_TCP_HOST" TCPPortNum:YOUR_SPLUNK_TCP_PORT];

    return YES;
}

[4] It is very easy to configure TCP input with Splunk Enterprise. The complete tutorial is available here at your perusal: http://docs.splunk.com/Documentation/Splunk/latest/Data/Monitornetworkports

TIME FOR SOME ANALYTICS
Splunk Enterprise and Storm will receive the data from your iOS app when it is correctly configured and this is a sample snapshot of how the stacktrace looks like.

Please give it a try and feel free to file any issues or suggestions here: https://github.com/nicholaskeytholeong/splunk-storm-mobile-analytics/issues

We look forward to getting your feedback to further improve this mobile analytics library and seeing you at .conf2013! Register here if you have not :)

----------------------------------------------------
Thanks!
Nicholas Key

Splunk
Posted by

Splunk

TAGS

Mobile Analytics (iOS) with Splunk and Storm (Part 2)

Show All Tags
Show Less Tags

Join the Discussion