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

Ensuring your code is correct


Just before we move further into developing our code, I just want to give you a heads up that as the number of lines of code increases within our dashboards, there will be more chances for incorrect syntax to cause your pages to error or not load correctly. To give an example, the following section will require you to add new libraries into a statement in the JavaScript code. You will need to ensure that all the lines are separated with a comma (,) and if this does not occur, you will most likely be presented with a dashboard that will not load correctly and look similar to the following screenshot:

The dashboard is trying to load a library that cannot be found, and as a result will simply hang in the Loading state. I will try to do my best to point these issues out to minimize them from occurring, but as your experience grows, you will get used to the errors that you see. This is also where a good code editor will come in handy, as it will help point out potential...