
Throughout the course, we will be covering the fundamental concepts of Splunk so that you can learn quickly and efficiently. As the concepts become more complex, we reserve their deep discussion for Splunk's online documentation or the vibrant Splunk online community at http://docs.splunk.com. Wherever necessary, we provide links to help provide you with the practical skills and examples so that you can get started quickly. This course is for anyone who needs to get reports and analytics from machine data
Let’s get started with the installation and set up our environment.
Splunk is a search, reporting, and analytics software platform for machine data. More organizations than ever are adopting Splunk to make informed decisions in such areas as IT operations, information security, and the Internet of Things (IoT).
In this chapter, you will learn about Splunk and how it relates to an often-used term – big data, as well as the most common methods of ingesting data into Splunk. The chapter will also introduce essential concepts such as forwarders, indexes, events, event types, fields, sources, and source types. It is paramount that you learn this early on as it will empower you to get the most value from your data.
Big data is a widely used term but, as is often the case, one that means different things to different people. In this part of the chapter, we present common characteristics of big data.
Splunk was invented as a way to keep track of and analyze machine data coming from a variety of computerized systems. It is a powerful platform for doing just that. But since its invention, it has been used for a myriad of different data types, including streaming log data, database, and spreadsheet data, and data provided by web services. The various types of data that Splunk is often used for are explained in the next few sections.
Indexes are where Splunk Enterprise stores all the data it has processed. Let’s look at it in more detail.
You may have noticed that there is a certain pattern in this configuration file, in which folders are broken into three locations: coldPath, homePath, and thawedPath. This is a very important concept in Splunk. An index contains compressed raw data and associated index files which are spread out into age-designated directories. Each age-designated directory is called a bucket.
Any configuration you make in the Splunk portal corresponds to a *.conf file written under the $SPLUNK_HOME directory. The same goes for the creation of data inputs; adding data inputs using the Splunk user interface creates a file called inputs.conf.
All throughout this chapter, you have been running Splunk search queries that have returned data. It is important to understand what events and fields are before we go any further, for an understanding of these is essential to comprehend what happens when you run Splunk on the data.
Most raw data that you will encounter will have some form of structure. Just like a CSV (comma-separated value) file or a weblog file, it is assumed that each entry in the log corresponds to some sort of format. Splunk makes custom field extraction very easy, especially for delimited files. Let’s look at it.
Let us summarize what we learned from this lesson.
This lesson covers more about using search and other commands to analyze your data.
Search processing language (SPL), a special-purpose processing language, was developed to enable fast searching on machine-generated data indexed by Splunk. The language was originally set up to be based on the Unix pipeline and Standard Query Language (SQL). SPL (as opposed to SQL) is a library of all search processing commands and their functions, arguments, and clauses. With a search command, you can group different events, filter data based on a constraint, extract fields using regular expressions, perform statistical calculations, and other tasks. Let's dissect a search query so that you can understand exactly how it works.
Every time you execute a search, always be aware that you are running a query against a set of data that is bound by date and time. Let’s look at it in detail.
A common use of the stats command is to count events. Let’s see how it works.
Let us summarize what we learned from this lesson.
This lesson shows how to classify your data using Event Types, enrich it using Lookups, and normalize it using Tags.
When working with Splunk daily, you will find many of the tasks and searches you run are repeated on a periodic basis. As shown earlier, storing field extraction logic in a single place allows it to be reused in the future. Another way to make things easier and also shorten searches is to create Event Types. Event Types are not the same as events; an event is just a single instance of data. An Event Type is a grouping or classification of events meeting the same search criteria.
Tags in Splunk are useful for grouping events with related field values. Unlike Event Types, which are based on specified search commands, Tags are created and mapped to specific field-value combinations. Multiple Tags can be assigned to the same field-value combination.
Occasionally you will require pieces of data to be rendered in a more readable manner. A common example to go through using our Eventgen data is with HTTP status. Computer engineers are often familiar with HTTP status codes as three-digit numbers. Business analysts or more casual users may not know the meaning of these codes and require a textbased description to comprehend the search results. In Splunk, you can enrich event data using Lookups, which can pair numbers or acronyms with more understandable text descriptions found in a separate file.
In this chapter, you have learned three very important things: classifying raw events using Event Types, classifying data using Tags, and enriching data using Lookups. These, in addition to good SPL, constitute essential elements you need to use Splunk in an efficient manner. Splunk reports are saved searches which can be shared to others or used as a dashboard panel. Reports can be scheduled periodically and perform an action upon completion, such as sending an email with the report results.
Alerts are crucial in IT and security operations. They provide proactive awareness of the state of the systems to those persons who monitor and control them. Alerts enable you to act fast when an issue has been detected, as opposed to waiting for a user to run a report and find the issue, which may or may not happen. In today's world, every minute someone has breached your network is costly and potentially devastating. However, alerts are only good if they are controlled and if they provide enough actionable information. They should not be created on low-priority items or triggered too often to the point they lose relevance.
In this section we will learn to accelerate a data model to speed up retrieval of data.
No matter how advanced and well-scaled your Splunk infrastructure is, if all scheduled reports and alerts are running at the same time, the system will start experiencing performance issues. Typically, you will receive a Splunk message saying that you have reached the limit of concurrent or historical searches. There are only a certain number of searches that can be run on fixed CPU capacity for each Splunk server or collection of servers. A common problem a Splunk administrator will inevitably face is how to limit the number of searches running at the same time. One way to fix this is to throw more servers into you Splunk environment, but that is not a cost-efficient way.
Let us summarize what we learned from this lesson.
In this lesson we will create a fully functional form-based dashboard that will allow you to change the inputs and affect the dashboard data by using tokens and assigning them to search panels.
Splunk is easy to use for developing a powerful analytical dashboard with multiple panels. A dashboard with too many panels, however, will require scrolling down the page and can cause the viewer to miss crucial information.
With the dashboard layout complete, it is time to make it dynamic and interactive. Before jumping into the exercises, however, we'll review the key concepts related to form inputs first.
In this section, we will create a real-time dashboard that will display crucial information based on the data we have.
A choropleth map, whose name comes from two Greek words meaning area/region and multitude, is a two-dimensional map where areas are designated by color shades or patterns to indicate the measured strength of a statistical indicator, such as sales per area or crime rates. We will not cover in detail the mathematical details of how a choropleth is created, but we are fortunate that we can use Splunk to provide this effective visualization tool for us. We will create two choropleth maps to denote bookings by region and traffic by region.
Let us summarize what we learned from this lesson.
In this lesson we will use a very intuitive Pivot editor to create three different visualizations: area chart, pie chart, and single value with a trend sparkline.
A data model is a hierarchical mapping of data based on search results. The output of the data model's underlying search queries can be visualized as a set of rows and columns in a spreadsheet, using the Pivot tool.
When you enable acceleration for a data model, Splunk internally pre-summarizes the data defined by the data model for a given time range. This gives a tremendous boost to the search speed for your data model when searches are executed within the given time range.
Let us summarize what we learned from this lesson.
This lesson discusses the HTTP event collector (HEC) and how it can be used to send data directly from an application to Splunk.
The Splunk HEC is a useful and commonly used part of Splunk. The HEC does the important function of collecting and sending HTTP and HTTPS events to other systems. One common example where the HEC adds tremendous value is by capturing/sending events from/to web and mobile-based client devices. Once Splunk captures the data via the HEC from the application, it can be used for a variety of analyses related to application use and errors.
Let us summarize what we learned from this lesson.
This lesson introduces a few extra skills that will help make you a powerful Splunker.
In this section, we will discuss searching within an index, search modes (fast, smart, verbose), and event sampling
There are various kinds of advanced searches you may need as you plan out how to create searches and dashboards for your data. Consider the ones that we present; they will help you design queries that are more efficient and cost effective. We will demo sub-searches, appending searches, joins, if statements, and case matching.
Let us summarize what we learned from this lesson.
This lesson concludes our course with thoughts, concepts, and ideas to take this new knowledge ahead and apply to an organization.
Most organizations will start using Splunk in one of three areas: IT operations management, information security, or development operations (DevOps).
As an organization deploys Splunk, it will have specific requirements related to the architecture, its resiliency, and disaster recovery.
When considering software for organizational purposes, it is important in today's world to consider online presence and community. Is the community very closed with little community fanfare or is it more open with significant online resources, documentation, and other community-based assets. In addition to the great product, Splunk is also successful because it has a strong online community which is built, in large part, to help customers successfully implement the product for their needs.
Let us summarize what we learned from this lesson.
Splunk has evolved from a normal log monitoring tool to a de facto tool used in almost every enterprise, spanning from IT to security and even marketing.
This course will get you off to a steady start by helping you understand how to install Splunk and set up a sample machine data generator, called Eventgen. By learning how to create various reports, dashboards, and alerts, you’ll then be able to analyze and visualize your data with a completely new perspective. You’ll later explore how to model data for business users using Splunk's Pivot functionality. As you cover more chapters, you’ll get up to speed with testing Splunk's powerful HTTP Event Collector and send data to Splunk Enterprise and Splunk Cloud. After covering core Splunk functionality, you'll gain insights into some real-world best practices for using this technology. Throughout this fully updated edition, you’ll also come across ’Tips from the Fez’, which are additional comments and best practice recommendations from a member of the SplunkTrust Community.
By the end of this course, you’ll know exactly how to use the many features of Splunk to your advantage and transform your machine data into resourceful insights that positively affect business decisions.
About the Author
J-P Contreras, a Splunk-certified administrator and sales engineer, has delivered value-oriented data analytics and performance planning solutions for more than 20 years. He has built award-winning consulting teams to help companies turn data into analytical insights. He helps companies implement Splunk. He received his MBA in e-commerce from DePaul University's Kellstadt Graduate School of Business, Chicago, in 2001. He trains in DePaul's Continuing Education Program and is a member of DePaul's Driehaus School of Business Advisory Board.
Erickson Delgado is an enterprise architect living in Orlando who loves to mine and analyze data. He began using Splunk in version 4.0 and has pioneered its use into his current work. He has worked with start-up companies in the Philippines to help build their open-source infrastructure. He has developed applications with Python and Node.js, is interested in Go, and loves recovering programming with C/C++. In recent years, he engaged himself in employing DevOps in his work. He blows off steam by saltwater fishing, mountain biking, crafting robots, and touring the country.
Betsy Page Sigman is a distinguished professor at the McDonough School of Business at Georgetown University in Washington, D.C. She has taught courses in statistics, project management, databases, and electronic commerce for the last 16 years, and has been recognized with awards for teaching and service. She has also worked at George Mason University in the past. Her recent publications include a Harvard Business case study and a Harvard Business review article. Additionally, she is a frequent media commentator on technological issues and big data
Adam Frisbee is a 15 year IT veteran and holds an MS in Information Systems from the University of Utah, where he also teaches graduate and undergraduate classes in Information Systems. His expertise is in cloud computing, VMware, Splunk, data warehousing, systems analysis and design, networking and servers, and university-level teaching.