Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Implementing Splunk: Big Data Reporting and Development for Operational Intelligence
Implementing Splunk: Big Data Reporting and Development for Operational Intelligence

Implementing Splunk: Big Data Reporting and Development for Operational Intelligence: Learn to transform your machine data into valuable IT and business insights with this comprehensive and practical tutorial

eBook
€28.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Implementing Splunk: Big Data Reporting and Development for Operational Intelligence

Chapter 2. Understanding Search

To successfully use Splunk, it is vital that you write effective searches. Using the index efficiently will make your initial discoveries faster, and the reports you create will run faster for you and others. In this chapter, we will cover:

  • How to write effective searches

  • How to search using fields

  • Understanding time

  • Saving and sharing searches

Using search terms effectively


The key to creating an effective search is to take advantage of the index. Splunk's index is effectively a huge word index, sliced by time. The single most important factor for the performance of your searches is how many events are pulled from disk. The following few key points should be committed to memory:

  • Search terms are case insensitive: Searches for error, Error, ERROR, and ErRoR are all the same thing.

  • Search terms are additive: Given the search item mary error, only events that contain both words will be found. There are Boolean and grouping operators to change this behavior; we will discuss these later.

  • Only the time frame specified is queried: This may seem obvious, but it's a big difference from a database, which would always have a single index across all events in a table. Since each index is sliced into new buckets over time, only the buckets that contain events for the time frame in question need to be queried.

  • Search terms are words, not parts...

Boolean and grouping operators


There are a few operators that you can use to refine your searches (note that these operators must be in uppercase to not be considered search terms):

  • AND is implied between terms. error mary is the same as error AND mary.

  • OR allows you to specify multiple values. error OR mary means "find any event that contains either word".

  • NOT applies to the next term or group. error NOT mary would find events that contain error but do not contain mary.

  • "" identifies a phrase. "Out of this world" will find this exact sequence of words. Out of this world would find any event that contains all of these words, but not necessarily in that order.

  • ( ) is used for grouping terms. Parentheses can help avoid confusion in logic. For instance, these two statements are equivalent:

    • bob error OR warn NOT debug

    • (bob AND (error OR warn)) AND NOT debug

  • = is reserved for specifying fields. Searching for an equal sign can be accomplished by wrapping it in quotes.

  • [ ] is used to perform...

Clicking to modify your search


Though you can probably figure it out by just clicking around, it is worth discussing the behavior of the GUI when moving your mouse around and clicking.

  • Clicking on any word or field value will add that term to the search.

  • Clicking on a word or field value that is already in the query will remove it from the query.

  • Clicking on any word or field value while holding down Alt (option on the Mac) will append that search term to the query, preceded by NOT. This is a very handy way to remove irrelevant results from query results.

Event segmentation

In Chapter 1, The Splunk Interface, we touched upon this setting in the Options dialog. The different options change what is highlighted as you mouse over the text in the search results, and therefore what is added to your query when clicked on. Let's see what happens to the phrase ip=10.20.30.40 with each setting:

  • inner highlights individual words between punctuation. Highlighted items would be ip, 10, 20, 30, and 40.

  • outer...

Using fields to search


When we explored the GUI in Chapter 1, The Splunk Interface, you probably noticed fields everywhere. Fields appear in the field picker on the left and under every event. Where fields actually come from is transparent to the user, who simply searches for key=value. We will discuss adding new fields in Chapter 3, Tables, Charts, and Fields, and in Chapter 10, Configuring Splunk.

Using the field picker

The field picker gives us easy access to the fields currently defined for the results of our query. Clicking on any field presents us with details about that field in our current search results.

As we go through the following items in this widget, we see a wealth of information right away:

  • Appears in X% of results is a good indication of whether we are getting the results we think we're getting. If every event in your results should contain this field, and this is not 100 percent, either your search can be made more specific or a field definition needs to be modified.

  • Show...

Using wildcards efficiently


Though the index is based on words, it is possible to use wildcards when needed, although some care must be taken.

Only trailing wildcards are efficient

Stated simply, bob* will find events containing Bobby efficiently, but *by or *ob* will not. The latter cases will scan all events in the time frame specified.

Wildcards are tested last

Wildcards are tested after all other terms. Given the search: authclass *ob* hello world, all other terms besides *ob* will be searched first. The more you can limit the results using full words and fields, the better your search will perform.

Supplementing wildcards in fields

Given the following events, a search for world would return both events:

2012-02-07T01:04:31.102-0600 INFO AuthClass Hello world. [user=Bobby, ip=1.2.3.3]
2012-02-07T01:23:34.204-0600 INFO BarClass Goodbye. [user=Bobby, ip=1.2.3.3, message="Out of this world"]

What if you only wanted the second event, but all you know is that the event contains world somewhere in...

All about time


Time is an important and confusing topic in Splunk. If you want to skip this section, absorb one concept—time must be parsed properly on the way into the index as it cannot be changed later without indexing the raw data again.

How Splunk parses time

Given the date 11-03-04, how would you interpret this date? Your answer probably depends on where you live. In the United States, you would probably read this as November 3, 2004. In Europe, you would probably read this as March 11, 2004. It would also be reasonable to read this as March 4, 2011.

Luckily, most dates are not this ambiguous, and Splunk makes a good effort. It is absolutely worth the trouble to give Splunk a little help by configuring the time format. We'll discuss the relevant configurations in Chapter 10, Configuring Splunk.

How Splunk stores time

Once the date is parsed, the date stored in Splunk is always stored as GMT epoch. Epoch time is the number of seconds since January 1, 1970, the birthday of Unix. By storing...

Making searches faster


We have talked about using the index to make searches faster. When starting a new investigation, following a few steps will help you get results faster:

  1. Set the time to the minimum time that you believe will be required to locate relevant events. For a chatty log, this may be as little as a minute. If you don't know when the events occurred, you might search a larger time frame and then zoom in by clicking on the timeline while the search is running.

  2. Specify the index if you have multiple indexes. It's good to get into the habit of starting your queries with the index name, for example, index=myapplicationindex error bob.

  3. Specify other fields that are relevant. The most common fields to specify are sourcetype and host, for example, index=myapplicationindex sourcetype="impl_splunk_gen" error bob.

    Note

    If you find yourself specifying the field source on a regular basis, you could probably benefit from defining more source types. Avoid using the sourcetype field to capture...

Sharing results with others


It is often convenient to share a specific set of results with another user. You could always export the results to a CSV file and share it, but this is cumbersome. Instead, to use a URL for sharing, start by choosing Save & share results… from the Save menu.

This opens the Save and Share Results panel.

The URL under Link to the results can be copied and sent to other users. A user visiting this URL will see exactly the same results you did, assuming the job has not expired.

The results are also available in the Jobs window. Clicking on the Jobs link in the top bar opens the Jobs window.

The App menu, Owner menu, Status menu, and search bar let you filter what jobs are displayed.

The table has the following columns:

  • Dispatched at is the time at which the search started.

  • Owner is the user that started the job. Sometimes jobs will appear with system as the user if the saved search is configured in an application but not owned by a particular user.

  • Application specifies...

Saving searches for reuse


Let's build a query, save it, and make an alert out of it.

First, let's find errors that affect mary, one of our most important users. This can simply be the query mary error. Looking at some sample log messages that match this query, we see that some of these events probably don't matter (the dates have been removed to shorten the lines).

  ERROR LogoutClass error, ERROR, Error! [user=mary, ip=3.2.4.5]
  WARN AuthClass error, ERROR, Error! [user=mary, ip=1.2.3.3]
  ERROR BarCLass Hello world. [user=mary, ip=4.3.2.1]
  WARN LogoutClass error, ERROR, Error! [user=mary, ip=1.2.3.4]
  DEBUG FooClass error, ERROR, Error! [user=mary, ip=3.2.4.5]
  ERROR AuthClass Nothing happened. This is worthless. Don't log this.[user=mary, ip=1.2.3.3]

We can probably skip the DEBUG messages; the LogoutClass messages look harmless; and the last message actually says that it's worthless.

mary error NOT debug NOT worthless NOT logoutclass limits the results to:

  WARN AuthClass error...

Creating alerts from searches


Any saved search can also be run on a schedule. One use for scheduled searches is firing alerts. To get started, choose Alert… from the Create menu.

A wizard interface is presented, covering three steps.

Schedule

The Schedule step provides the following options:

  • Trigger in real-time whenever a result matches: This option will leave a real-time search running all the time and will immediately fire an alert whenever an event is seen.

    This option will create an alert every time an event that matches your search occurs. There is an important throttling option in the next step.

  • Run on a schedule once every…: New options now appear below the menu.

    • Schedule: You can choose to either run your search on a set schedule or run your alert according to a cron schedule. Keep in mind that the time frame selected in the time picker will be used each time the query runs—you probably don't want to run a query looking at 24 hours of data every minute.

    • Trigger if lets you choose when...

Summary


In this chapter, we covered searching in Splunk and doing a few useful things with those search results. There are lots of little tricks that we will touch upon as we go forward.

In the next chapter, we will start using fields for more than searches; we'll build tables and graphs, and then, we'll learn how to make our own fields.

Left arrow icon Right arrow icon

Key benefits

  • Learn to search, dashboard, configure, and deploy Splunk on one machine or thousands
  • Start working with Splunk fast, with a tested set of practical examples and useful advice
  • Step-by-step instructions and examples with a comprehensive coverage for Splunk veterans and newbies alike

Description

Splunk is a data collection, indexing, and visualization engine for operational intelligence. It's a powerful and versatile search and analysis engine that lets you investigate, troubleshoot, monitor, alert, and report on everything that's happening in your entire IT infrastructure from one location in real time. Splunk collects, indexes, and harnesses all the fast moving machine data generated by our applications, servers, and devices - physical, virtual, and in the cloud.Given a mountain of machine data, this book shows you exactly how to learn to use Splunk to make something useful from it. Depending on your needs, you can learn to search, transform, and display data, or learn to administer your Splunk installation, large or small. "Implementing Splunk: Big Data Reporting and Development for Operational Intelligence" will help you get your job done faster, whether you read from the beginning or jump to what you need to know today. New and experienced users alike will find nuggets of wisdom throughout.This book provides you with valuable examples and step-by-step instructions, showing you how to take advantage of everything Splunk has to offer you, to make the most out of your machine data."Implementing Splunk: Big Data Reporting and Development for Operational Intelligence" takes you on a journey right from inception to a fully functioning implementation of Splunk. Using a real-world data walkthrough, you'll be shown how to search effectively, create fields, build dashboards, reports, and package apps, manage your indexes, integrate into the enterprise, and extend Splunk. This practical implementation guide equips you with high-level knowledge for configuring, deploying, extending, and integrating Splunk. Depending on the goal and skills of the reader, enough topics are covered to get you on your way to dashboard guru, app developer, or enterprise administrator. This book uses examples curates reference, and sage advice to help you make the most of this incredibly powerful tool.

Who is this book for?

The book targets professionals and organizations who want to implement or have already implemented Splunk for log analysis and indexing. Analysts and IT staff for end-to-end investigation, performance monitoring, and so on will also learn from the practical examples. It would even help managers to build reports and summarize the health, performance, and activity of their IT infrastructure and business. You will also find it helpful as a technical administrator, consultant, or end user.This book aims to be useful to Splunk users of all levels, from complete newbie to seasoned user. The book assumes that you have access to a copy of Splunk, ideally not in production. Many examples also assume your user has admin rights.

What you will learn

  • How to write searches that are fast and lean
  • How to create fields from your unstructured data
  • How to enrich your data with lookups and commands
  • How to transform your data into useful and beautiful reports
  • How to build professional looking and informative dashboards
  • How to make apps to organize and share your searches and dashboards
  • How to manage configurations for one to thousands of instances
  • How to integrate with enterprise systems
  • How to extend Splunk with scripts and advanced configuration

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jan 24, 2013
Length: 448 pages
Edition : 1st
Language : English
ISBN-13 : 9781849693295
Vendor :
Splunk
Category :
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jan 24, 2013
Length: 448 pages
Edition : 1st
Language : English
ISBN-13 : 9781849693295
Vendor :
Splunk
Category :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 125.97
Mastering Splunk
€41.99
Splunk Operational Intelligence Cookbook
€41.99
Implementing Splunk: Big Data Reporting and Development for Operational Intelligence
€41.99
Total 125.97 Stars icon

Table of Contents

12 Chapters
The Splunk Interface Chevron down icon Chevron up icon
Understanding Search Chevron down icon Chevron up icon
Tables, Charts, and Fields Chevron down icon Chevron up icon
Simple XML Dashboards Chevron down icon Chevron up icon
Advanced Search Examples Chevron down icon Chevron up icon
Extending Search Chevron down icon Chevron up icon
Working with Apps Chevron down icon Chevron up icon
Building Advanced Dashboards Chevron down icon Chevron up icon
Summary Indexes and CSV Files Chevron down icon Chevron up icon
Configuring Splunk Chevron down icon Chevron up icon
Advanced Deployments Chevron down icon Chevron up icon
Extending Splunk Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.9
(11 Ratings)
5 star 27.3%
4 star 54.5%
3 star 9.1%
2 star 0%
1 star 9.1%
Filter icon Filter
Top Reviews

Filter reviews by




Putzmanmusing Dec 25, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great book and shows you how splunk is thee tool for big data. This proves the point that's Splunk today is not your grandfathers Splunk of yesterday.
Amazon Verified review Amazon
Amazon Customer Sep 01, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I really enjoyed this book and in a weekend it took an awful lot the mystery out of Splunk and got me productive very quickly.
Amazon Verified review Amazon
Paul Schofield Mar 23, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Vince does a great job of walking a user through installing, configuring, using and optimizing Splunk for any organization. There are many chapters that I will read and re-read as I use Splunk everyday to get my IT work done.Thumbs up!
Amazon Verified review Amazon
Jason Mar 03, 2014
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
This book is a must read if you are planning to implement Splunk in your environment. I was looking for more of what it can do and how to do it, but still worth my time.
Amazon Verified review Amazon
Tfritz Feb 05, 2014
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Very good book for beginner to intermediate. Its a little light on specifics for some of the more complicated tasks. Splunks web site isn't the best source for documentation so it's nice to have a reference.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.