![]() ![]() Next, we’ll create the Simple XML view that exposes our JavaScript code on a setup page in Splunk Web. We’ll save this setup_page.js file as a Simple XML extension in the $SPLUNK_HOME/etc/apps/APP_NAME/appserver/static/javascript directory.įor the complete example code, see setup_page.js in the splunk-app-examples repository on GitHub. We can use any JavaScript libraries and tools that we want to code the app’s setup process. Code the setup process for the appįirst, we’ll write the JavaScript code to check for app dependencies, as shown in the following image. In this example, we’ll take a look at a setup page that verifies whether a user has installed and configured a second, dependent app. Now, let’s walk through how to create a setup page. ![]() To pass Splunk AppInspect, you must use a setup page if your app requires user-provided configurations. Setup.xml is a deprecated feature that is not supported in Splunk Cloud. You might be familiar with using setup.xml for app configuration. The ability to configure an app through the front end is especially important in Splunk Cloud because customers do not have access to the command-line or file system. Setup pages enable users to store custom settings and configurations using Splunk Web, without the need to manually update configuration files. Using a setup page for app configuration simplifies the setup process for end users. This diagram shows how a user interacts with a setup page to configure a Splunk app. After the user completes the setup process, the setup page updates the app.conf file to mark the configuration as complete and redirects the user to the app’s home page. This Simple XML view uses a Simple XML extension written in JavaScript that contains the logic to configure the app. If the app is not configured, the user is directed to the app’s setup page, a Simple XML view that you specify in the app.conf file. If the app is configured, the user is directed to the app’s home page. When a user launches an app for the first time, Splunk software checks the app.conf file to determine whether the app is configured. Integrating with an external service: You can create a setup page to authenticate your app’s users with a third-party service so that they can retrieve and use data from an external API.Storing user-provided configurations: You can create a setup page to capture user input and save this information in a configuration (.conf) file.Checking for app dependencies: You can create a setup page to verify whether your users have installed all of the apps and add-ons that your app relies on before they start using your app.So, what can you accomplish with setup pages? Here are the key uses: Setup pages allow your app’s users to input custom app configurations and settings through the Splunk Web user interface. Does your Splunk app require user-provided configurations to run? If so, you can use a setup page to collect and store this information.Ī setup page is a page in a Splunk app that displays the first time a user launches the app. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |