This documentation is for WSO2 IoT Server 3.2.0. View the documentation for the latest release.
Customizing the Android Agent to Analyze Device Logs - IoT Server 3.2.0 - WSO2 Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
||
Skip to end of metadata
Go to start of metadata

You will want to analyze the data gathered from the devices that are registered with WSO2 IoT Server. Wondering how you can do this in WSO2 IoT Server?

WSO2 IoT Server uses Splunk to capture, index and correlate the real-time data into a searchable repository. Using the data in this repository you are able to generate graphs, reports, alerts, dashboards, and more. 

Le's take a look at how you can configure Splunk with the WSO2 IoT Server Android Agent.

  1. Download the Android agent source code. This will be referred to as the <ANDROID_AGENT_SOURCE_CODE> throughout this document.

  2. Open the <ANDROID_AGENT_SOURCE_CODE>/client/client/src/main/java/org/wso2/emm/agent/utils/Constant.java file.

  3. Define SPLUNK_PUBLISHER as the value for the string variable LOG_PUBLISHER_IN_USE.

    public static final String LOG_PUBLISHER_IN_USE = SPLUNK_PUBLISHER;
  4. Configure the fields shown below:

    public final class SplunkConfigs {
      public static final String API_KEY = "<SPLUNK_API_KEY>";
      public static final String TYPE_HTTP = "HTTP";
      public static final String TYPE_MINT = "MINT";
      public static final String DATA_COLLECTOR_TYPE = TYPE_MINT;
      public static final String HEC_TOKEN = "<SPLUNK_HEC_TOKEN>";
      public static final String HEC_MINT_ENDPOINT_URL = "<SPLUNK_HEC_MINT_ENDPOINT_URL>";
    }
    FieldDescription
    API_KEY
    Provide the Splunk API Key.
    HEC_TOKEN
    Provide the HTTP Event Collector token.
    HEC_MINT_ENDPOINT_URL
    Provide the HTTP Event Collector endpoint URL.
  5. Apply the logcat operation on your device to push data to Splunk through WSO2 IoT Server.

    For more information on applying an operation on your device, see the Android device operations.

  • No labels