How to manage applications using Splunk SDK for C# v2.x

The Splunk SDK for C# allows you to manage applications on your Splunk Enterprise instance.

The application APIs

The APIs for working with applications are:

  • The Application class provides an object representation of an app in Splunk Enterprise.
  • The ApplicationArchiveInfo class provides information about an application archive produced by Splunk Enterprise.
  • The ApplicationAttributes class provides arguments for setting the attributes of an application.
  • The ApplicationCollection class provides an object representation of a collection of Splunk Enterprise apps.
  • The ApplicationSetupInfo class represents the setup information for an application.
  • The ApplicationUpdateInfo class provides an object representation for the update information available for an application.
  • The Applications property of the Service object gets the applications.

For example, the following code snippet (from the list_apps example) uses the ApplicationCollection.GetAllAsync() method to retrieve a collection of all the installed applications that the logged-in user has access to.

Console.WriteLine("List of Apps:");

// get a collection of all applications
await service.Applications.GetAllAsync();

foreach (var app in service.Applications)
{
    Console.WriteLine(app.Name);
    // write a separator between the name and the description of an app
    Console.WriteLine(Enumerable.Repeat<char>('-', app.Name.Length).ToArray());
    Console.WriteLine(app.Description);
}