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
All 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
Arrow up icon
GO TO TOP
Implementing Splunk 7, Third Edition

You're reading from   Implementing Splunk 7, Third Edition Effective operational intelligence to transform machine-generated data into valuable business insight

Arrow left icon
Product type Paperback
Published in Mar 2018
Publisher Packt
ISBN-13 9781788836289
Length 576 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Toc

Table of Contents (19) Chapters Close

Title Page
Packt Upsell
Contributors
Preface
1. The Splunk Interface FREE CHAPTER 2. Understanding Search 3. Tables, Charts, and Fields 4. Data Models and Pivots 5. Simple XML Dashboards 6. Advanced Search Examples 7. Extending Search 8. Working with Apps 9. Building Advanced Dashboards 10. Summary Indexes and CSV Files 11. Configuring Splunk 12. Advanced Deployments 13. Extending Splunk 14. Machine Learning Toolkit Index

Using Splunk from the command line


Almost everything that can be done via the web interface can also be accomplished via the command line. For an overview, see the output of /opt/splunk/bin/splunk help. For help on a specific command, use /opt/splunk/bin/splunk help [commandname].

The most common action performed on the command line is search. For example, have a look at the following code:

$ /opt/splunk/bin/splunk search 'foo'2012-08-25T20:17:54 user=user2 GET /foo?q=7148356 uid=MzA4MTc5OA2012-08-25T20:17:54 user=user2 GET /foo?q=7148356 uid=MzA4MTc5OA2012-08-25T20:17:54 user=user2 GET /foo?q=7148356 uid=MzA4MTc5OA

The things to note here are as follows:

  • By default, searches are performed over All time. Protect yourself by including earliest=-1d or an appropriate time range in your query.
  • By default, Splunk will only output 100 lines of results. If you need more, use the -maxout flag.
  • Searches require authentication, so the user will be asked to authenticate unless -auth is included as an argument...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images