SPLK-1002 Splunk Core Certified Power User – Splunk Apps And Add-On’s Part 4

  1. Creating your Own Splunk App Via Splunk Web

Now we have learned how to create apps using your linux cli or the splunk backend console. Now let us see how we can create our own apps using splunk web. That is your searcher where you can create your apps on the fly using your web console. For that. Click on Apps Management. That is the settings icon next to your apps which will take you to the installation of app screen where we have installed addons and other applications as part of our previous videos.

Now, here you have an option to create app. Click on Create app. So this it says this is the label that we gave during our previous app creation. That is we edited appcom in order to give a label for our application that should be displayed here. So this is the label that it is asking for. So we’ll give it a splunk label and the folder name you wish to call it. As previously we have given splunk underscore Demo. Now I’ll give demo one or we can call it Demo Web so that we are creating this app as part of the web. The version information you can give it whatever you wish, either, 1001, anything. It is visible. Yes and the author, the name of the person or the company who is creating this, and the description field which shows a short description about your application. Here we have two templates.

Previously we have created using our back end method the sample app. Now we will create with bare bones and we’ll see the difference between both the templates. Now, along with creation of the app, you can add your custom javascript, html or any other static contents like images. css files can be added as part of uploading the assets. You can choose if you have logos, background images, javascript, css files or even html files into this asset icon.

As of now we do not have any, so I’ll leave it blank. Click on save. As you can see, we have created our new splunk web demo app. So here you should be able to see our newly created app. So this is the app that we have recently created and this is the app that we have previously created as part of our back end. Here you’ll be able to see the splunk label that created. We’ll get into this newly created app and we’ll notice the difference between the sample app and the newly created app using barebone template. As you can see, this barebone template uses the same default xml or the navigation menu of the search and reporting app. Whereas our sample app included some default junk value which had only one menu.

But we have customized the navigation as per our requirement. But whereas the barebone includes your search and reporting default xml. So this is our custom created navigation. This is the search and reporting app which used by the barebone template. So you can choose whichever you wish to, but at the end of the day, we’ll customizing most of the navigation in our custom apps.

  1. Custom Navigation inside Apps Using Splunk Web

As part of our learning to create an app using splunk Web, we will see how to customize this newly created splunk app that is using splunk Web. As you can see, we are using splunk demo Web, that is the Web. We have used the web component of splunk to create this app and we’ll see how we can and edit this navigation using splunk Web. In order to edit this navigation, go to Settings. Click on user interface. Under User Interface you will see many menus which are the ui component of splunk. But we’ll be focusing here mainly on the navigation menus.

Click on navigation menus. We know by now that the navigation menu is the default xml file. So in order to edit this file, click on Default xml. That is default file. As you can see, this is the same file we saw while editing during the app creation using cli method. So here we’ll create a custom collection and probably we’ll change some random value. We’ll put it six abcd and Zero and let us see what color it pops up after saving this. So this is the collection and we will create our own collection. This is basic xml Editing. We are not doing anything much fancy here.

We are just adding a couple of tags. That is our collection tag. I close this collection tag. I’ll give this a label called Main Menu. And inside this I’ll create one more collection in order to show you how complex this visualization can be done using a simple xml editing. So I’ve created one more collection tag in order to make it more formatted so that you’ll be able to understand better. This is our new collection tag and I’ll give this a label called submenu. Let us save this and notice the difference in our navigation of newly created splunk demo that is using our web.

I’ll go ahead and save this. It will check for a syntax in case we have missed any tags. It will pop up with an error saying unexpected or error passing the xml and it is expecting a closure of our xml. So we have edited this xml in case if it notices any error. You will not be able to save this or modify this view. We have saved this. So once this has been successfully saved, go ahead and refresh your newly created demo app. You’ll be able to notice the difference.

As you can see, we have our newly edited color which is cool, that is blue color and there is a main menu which is as part of our let me open up the xml so that you’ll be able to better catch hold of things. This is our main menu. That is the top level collection. This tag and when I expand this, you get a data set that is direct linkage to a data set. The view name under that collection. As you can see, there is one more collection inside this collection named as submenu.

So here you get another menu as when you click it, opens up three other submenus. So this way you can customize your dashboards in much more interesting ways, where you’ll be able to present it in a better manner.

  1. Custom Static Content Location for Apps

As part of creating our own apps. We have a couple more small topics in order to cover and then we’ll be able to package our app successfully and submit it to our Splunkbased portal where it goes for an approval. Once reviewed, your app will be published and you’ll get a chance to go for 50 gb of license, which is free of cost for developer. And you can use this in order to create more apps, learn more about splunk and you can explore with 50 gb of data a lot more.

So in order to finish our chapter about how to create an app, we need to understand changing default colors which we have already seen. Changing the default colors in our default xml makes our complete ui look different. And also we can add new colors to the dashboard or apps by editing default xml. And we’ll now see where we can place our static contents like css and javascript, including images and html in our apps directory.

And finally we’ll see how to package an app and submit the app to splunkbase. So the first step here is let’s see where we can place our css, javascript, image files and html files, the static contents of your application inside your app. For this example, we’ll be considering the search app which is the default. Let us get into opt splunk, this is our splunk home etc apps, then followed by your custom created app. But here will be in order to understand javascript and css location, we’ll be using the Search app.

So under your app go to search and there will be a folder called App Server. So this is where all your static content goes in, in case if you have any executables like scripts, bash, script or batch, even exe files, dll files, all this can be inputted under Bin.

The app servers holds some of the important files for running this application. And also there is static where you will be uploading all your static contents, that is your image files. So here under static you can upload your app icon which is displayed as part of your search and reporting. One is this icon, the second one is on the launcher screen which you will be able to see.

You’ll be able to see your app icon. This is one icon, and the second icon is part of your app menu that is right next to your home button. So this is the app icon. So in this static folder you’ll be able to place these icons which are of specific sizes. Once you understand the app icons, let us see where we can place the other static elements. For that you need to go under App Server. Under app server. Go to static.

So here you’ll be able to see all the static elements of your app including css, html, app logos and any other images that are as part of your application. So make sure all your static elements goes under app server static Fold the next step is packaging of your application. In order to package your application. You can use any archiving software like Windrar, Wind, Zip or Seven Zip and you can select the package that you have developed and make sure, before packaging, all your configuration is placed under default.

So that since you are a developer, your source will not be modified and it will be used by the other splunk community member so that they can change their config configuration under local and they don’t mess up with your default configuration. You can package this app so that all the files are placed under your default location and then you can zip it or archive it with any of the archiving software.

  1. Changing Custom Background of Login Page

As part of our understanding about customization in splunk, let us see how we can customize the Login screen. The default login image that is the background image of your login page. In order to change it login to splunk. We’ll be seeing how we can customize this login login page using splunk Web. Then we’ll be seeing how to customize your logo of the splunk by replacing with your company logo using cli method. In order to begin, click on Settings server Settings. So this complete customization of your login page will be through split splunk Web. So once your server setting screen loads up, click on Login Background and as you can see by default it uses the splunk image. If you don’t need any image, you can select it as no image.

  1. Custom Logo for the Splunk Login Page

Which is this file. We’ll be uploading this logo and also we’ll be able to notice the changes. That was splunk web configuration. Let us go to our web which is in system local. If you go to webconf and as we can see here the login background image has been set to custom option that we choose in our splunk web console. Then the background images that is the image that we uploaded using the splunk web is stored under search app app server static. After that this is the complete path.

So app server static is the location where you need to upload all your static contents. We will see how our custom logo we are in system local. Let me go to opt splunk etc apps. This is your search app home directory. Under this it will be under observer static. So here will be our login custom background. That is the file that was as part of our web cons.

As you can see, this is the folder that it is referring under search application. That is login custom background. Under this folder you will be able to see the uploaded custom logo jpg and I’ve already uploaded our logo that is this file as part of our demonstration. In order to replace the splunk enterprise logo in your login page, all you need to do is add one more argument in your web. com. That is login custom logo.

The file that we are seeing is your logo dot jpg. As you can see it follows the similar path as of your background image. So we copied this file to our same folder and we’ll mention this under login custom logo parameter of web confart us plunk instance once it is successfully restarted we should be able to see a new image that us this image as part of our customer.

  1. Customizing App Icon

As part of our customization in splunk, we’ll be changing now the logo for our newly created application. So we’ll be changing logo for Splunk. com that we created as part of our linux cli. And this is the app that was created as part of splunk web console. Now let us disable this and go back to Splunk. com. In order to disable the app, go to Settings, that is your app settings. So once here, look for the app that you would like to disable. Click on disable. We have seen multiple ways of disabling app as part of our previous videos.

Now we have just the Splunk. com that we created as part of our learning of app creation using linux cli. That is the backend method. Now we’ll be seeing how to replace this default logo with our splunk logo itself. So in order to do that, go back to cli. That is our linux cli. Let me change the font size. So now I am in my search ed where the app is installed and I am at my user home, that is splunk home. I’ll go to splunk etc. Under etc. We’ll go to our app, that is the app that we created. And under this go to a folder called Static.

Okay, as of now, we don’t have any folder called Static. In order to change this icon, you need to have a Static folder under your application. So this is our application. Let us create a folder name Static where you will be copying your application logo. So for this example, as part of our learning, we’ll be copying the same logo of search and reporting into Splunk. com. If you have any customized logos of your organization or your teams, you can copy it directly into this location. So I’ll be copying from our search app Static folder. The file is called as app icon.

Now we have successfully copied the app icon. This is the file that will be used. But I have copied all the files so that it can render in all the pages of the application. So this file will be able to see, once we have restarted our splunk instance, how the icon app icon changes.

As soon as splunk is successfully restarted, go back and refresh the page. Our session will be expired. As you can see now our app icon has been successfully replaced by the search and reporting app itself. So this is how you typically change your app icon or can create your own app icon and place it under your application static folder.

img