Book Image

Learning Splunk Web Framework

By : Vincent Sesto
Book Image

Learning Splunk Web Framework

By: Vincent Sesto

Overview of this book

Building rich applications on the Web using Splunk is now simpler than ever before with the Splunk Web Framework. It empowers developers to build their own web applications with custom dashboards, tables, charts, form searches, and other functionalities in the datasets at their disposal. The book will start with the fundamentals of the Splunk Web Framework, teaching you the secrets of building interesting and user-friendly applications. In the first application, you will learn to analyze and monitor traffic hitting the NASA website and learn to create dashboards for it. You will then learn additional, and more detailed, techniques to enhance the functionalities of the app such as dashboards and forms, editing simple XML, using simple XML extensions, tokens, post-process searches, dynamic drill-downs, the Splunk Web Framework and REST API, and much more. The second app will use historical stock market data and will create custom dashboards using Splunk Web Framework; the book will now cover important topics such as creating HTML dashboards, enhancing the visual appeal of the app using CSS, and moving your app with SplunkJS. The book will provide different and interesting examples instead of the usual “Log, Index, Search, and Graph” so that Splunk will be the first tool readers think of to resolve a problem.
Table of Contents (15 chapters)
Learning Splunk Web Framework
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Preface

For some time now, Splunk has been a leading light in providing software that allows its users to search, monitor, and visualize data. The massive expansion in machine data seems endless but we are fortunate to have the tools to deliver and analyze this data and allow us to strip out the irrelevant information, presenting to our user base the important data that will help guide business and technology decisions. Two major strengths that Splunk provides are the ability to quickly analyze your data as well as the ability to present this information to your user in an attractive and customizable way. This presentation layer sitting within Splunk as part of the Splunk Web Framework is a powerful development platform from which we can almost endlessly customize the data we are providing. This book focuses directly on the Splunk Web Framework. It is designed to provide hands-on and interesting examples with step-by-step instructions, to help developers think of Splunk as a complete platform instead of software for searching, monitoring, and analyzing machine-generated data. This book provides different and interesting examples instead of the usual “Log, Index, Search, and Graph” and has the reader thinking in terms of Splunk being the first tool they think of when needing to resolve any problem.

What this book covers

Chapter 1, Splunk Web Framework Fundamentals, provides a high-level overview of the framework as well as discussing development environments and collaborating with development teams.

Chapter 2, Presenting Data to Users as a Splunk App, will introduce Splunk Apps and get you to use the Web Interface to create basic dashboards to present their data.

Chapter 3, Expand Your Apps Using Simple XML, expands you knowledge of Splunk App development by introducing Simple XML to manipulate the underlying dashboard code.

Chapter 4, Layouts, Navigation, and Menus, provides you with an overview of how to use Simple XML to control the layout of you dashboards as well as setting up a menu system for you Splunk App.

Chapter 5, Interacting with Your User While Speeding Up App Searches, discusses how to add features to your Simple XML code to allow your user to interact directly with their Splunk data.

Chapter 6, Moving from Simple XML to HTML, introduces HTML dashboards and provides an explanation of the HTML code that is generated as part of the Splunk dashboard.

Chapter 7, JavaScript Modules in Your HTML App, provides a discussion on how to work directly with JavaScript modules in your Splunk App to further enhance functionality.

Chapter 8, Utilizing CSS to Spice Up Visual Appeal, discusses working directly with CSS files to manipulate the look and feel of a dashboard and move away from the standard Splunk color scheme.

Chapter 9, Moving Your App off Splunk with SplunkJS, provides an in-depth introduction to using SplunkJS to create standalone web applications with the use of Splunk data.

What you need for this book

To be able to work along with the example applications created in this book, you will need to have the following items available:

  • A running version of Splunk Enterprise, preferably on Linux or Mac

  • Basic knowledge of Splunk and how it works, including creating searches and reports, indexing data, and knowledge of Web interface

  • A modern and stable web browser, such as Chrome or Firefox

  • A basic understanding of web technologies such as HTML, CSS, and JavaScript

  • Some basic knowledge of Python

  • An Internet connection

Who this book is for

This book is designed to start from an overview of the Splunk Web framework and get an inexperienced Splunk user to work fast with hands-on examples. The examples build on top of each other to cover more advanced topics, so it is hoped that even an experienced Splunk developer will be able to get something out of this book as the chapters progress.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "By clicking on the Splunk logo at the top left of the screen, we are brought to the home page,  http://localhost:8000/en-GB/app/launcher/home ."

A block of code is set as follows:

1 <dashboard> 
2   <label>SimpleXMLDashboard</label>

Any command-line input or output is written as follows:

echo "# SplunkAppDev" >> README.md

New terms and important words are shown in bold. 

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

For this book we have outlined the shortcuts for the Mac OX platform if you are using the Windows version you can find the relevant shortcuts on the WebStorm help page https://www.jetbrains.com/webstorm/help/keyboard-shortcuts-by-category.html.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

Downloading the color images of this book 

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/ApexDesignPatterns_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at [email protected] with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.