Splunk Search Pro Tips



Similar documents
Keeping Splunk in Check: Tools to BeGer Manage Your Investment

Frequently Asked Questions: Cisco Jabber 9.x for Android

Issue 1. Nokia and Nokia Connecting People are registered trademarks of Nokia Corporation

Using Splunk to Monitor the Customer Experience

Sierra Wireless AirCard Watcher Help for Mac OS X

BIG-IP Access Policy Manager and Splunk Templates

Table of contents 1. IMPORTANT INFORMATION BEFORE YOU START GETTING STARTED EXCHANGE CONTROL PANEL... 2

Splunk Enterprise 6.2.3

Understand Troubleshooting Methodology

Chapter 6 - Condor finder

OneDrive for Business User Guide

SchoolBooking SSO Integration Guide

Application for Splunk Enterprise

Database Replication Error in Cisco Unified Communication Manager

GlobalSCAPE DMZ Gateway, v1. User Guide

SSL EXPLAINED SSL EXPLAINED

Chapter 8 Router and Network Management

Analyzing Call Signaling

Exchange Granular Restore. User Guide

Exchange Granular Restore User Guide

Product Guide. Sawmill Analytics, Swindon SN4 9LZ UK tel:

Cisco Setting Up PIX Syslog

Flash Corruption: Software Bug or Supply Voltage Fault?

Cisco Expressway Basic Configuration

User Guide Online Backup

SuccessFactors Learning: Scheduling Management

#splunkconf. Analyzing & Mitigating Malicious Web Activity using Splunk Enterprise

SEO - Access Logs After Excel Fails...

edgebooks Quick Start Guide 4

Google Analytics: Tracking Where a Visitor Goes on Your Web Site

Nintex Workflow for Project Server 2010 Help

DiskPulse DISK CHANGE MONITOR

VPN Client User s Guide Issue 2

Configuring SSL VPN on the Cisco ISA500 Security Appliance

Cisco Secure PIX Firewall with Two Routers Configuration Example

Rational Application Developer Performance Tips Introduction

Dollar Universe SNMP Monitoring User Guide

Allworx Call Assistant Release Notes (Release 2.1.2)

TestManager Administration Guide

ipass Open Mobile 3.2.x for ios Quick Start Guide

Overview... 1 Requirements Installing Roles and Features Creating SQL Server Database... 9 Setting Security Logins...

Xerox 700 Digital Color Press with Integrated Fiery Color Server. Utilities

Office 365 ProPlus FAQ

PineApp Surf-SeCure Quick

Customization & Enhancement Guide. Table of Contents. Index Page. Using This Document

MLADEN

Qvis Security Technical Support Field Manual LX Series

Configuring PA Firewalls for a Layer 3 Deployment

Driver Updater Manual

Construct User Guide

Monitoring Remote Access VPN Services

Intellect Platform - Tables and Templates Basic Document Management System - A101

H3C Firewall and UTM Devices DNS and NAT Configuration Examples (Comware V5)

Personal Cloud. Support Guide for Mac Computers. Storing and sharing your content 2

IBM Security QRadar Vulnerability Manager Version User Guide IBM

Back-up Server DOC-OEMSPP-S/2014-BUS-EN-10/12/13

Internet Explorer Settings for use with Privia

Welcome to the Heritage Share Trading Website offering market-leading functionality to help you get more from your online trading and investing:

Exchange Granular Restore Instructional User Guide

Get Easy VSL Here to walk through step by step with us.

Example. Represent this as XML

KPN SMS mail. Send SMS as fast as !

Big Data and Analytics by Seema Acharya and Subhashini Chellappan Copyright 2015, WILEY INDIA PVT. LTD. Introduction to Pig

Quick Start Guide.

BI xpress Product Overview

Filtering remote users with Websense remote filtering software v7.6

State of Michigan Data Exchange Gateway. Web-Interface Users Guide

There are numerous ways to access monitors:

SalonTouch SQL and.net Database Backup Instructions Updated 10/16/2006

HP A-IMC Firewall Manager

Converting from Practice Management Classic to Practice Management Professional or Enterprise

Monitoring the Firewall Services Module

HOW TO CONNECT TO FTP.TARGETANALYSIS.COM USING FILEZILLA. Installation

Intelligent Process Management & Process Visualization. TAProViz 2014 workshop. Presenter: Dafna Levy

Hillstone StoneOS User Manual Hillstone Unified Intelligence Firewall Installation Manual

How To Use Quantum Rbs Inc. Small Business Backup

Planning and Managing Projects with Microsoft Project Professional 2013

Module Customer Ratings and Reviews Pro + Google Rich Snippets Module

1. Summary Operating Pre-Requisites Getting Started With New Views Favourites

Steps for Basic Configuration

Colligo Manager 6.2. Offline Mode - User Guide

FTP Accounts Contents

USB GSM 3G modem RMS-U-GSM-3G. Manual (PDF) Version 1.0,

Analyzing Log Analysis: An Empirical Study of User Log Mining

Installing, Uninstalling, and Upgrading Service Monitor

Introducing Unlimited* Storage protected and stored for 10 years in

Fairfield University Using Xythos for File Sharing

F-Secure Messaging Security Gateway. Deployment Guide

If you see "Skip installation of the current version and test the currently installed version of Java" then select that hyperlink.

1 Which of the following questions can be answered using the goal flow report?

Kiwi SyslogGen. A Freeware Syslog message generator for Windows. by SolarWinds, Inc.

How to Use Remote Access Using Internet Explorer

CHAPTER 2: USING THE CAMERA WITH THE APP

BOA BARRACUDA ON ÆGIR ~ MY FIRST YEAR ~ Mladen

LEARNING MANAGEMENT SYSTEM MANAGER GUIDE

Introduction to scripting with Unity

Kaseya 2. User Guide. Version 1.1

Transcription:

Splunk Search Pro Tips Dan Aiello, Principal Cyber Security Engineer Splunk.conf2015 Dan Aiello Principal Cyber Security Engineer, MITRE Approved for Public Release; Distribution Unlimited. 15-2752.

Agenda 2 My background Comments Search by index In the year 2000 Red Card Watch Lists Search Job Inspector More fun with subsearches Carrier signal Imaginary events Summary 2

My Splunk background 3 4 years Splunk experience SOC is primary user base 6 indexers 350 GB data/day 90 indexes 170 sourcetypes

4 comments // No comment

5 Comment your Splunk search sourcetype=access_combined_wcookie eval COMMENT="This is my comment" or sourcetype=access_combined_wcookie rename COMMENT - > "This is my comment" * There s nothing special about the word COMMENT, use whatever you like

rename vs. eval for comments? 6 In practice, it does not seem to matter In a few odd circumstances, I have seen rename be faster than eval

Why would you need comments? 7

8 Search by index

Searching by index and sourcetype 9 Specifying an index in your search speeds it up This difference is less pronounced in Fast Mode

10 In the year 2000 In the year 3000

Get with the times 11 Timestamps are extremely important for Splunk data Detected at index time, set forever Cannot be fixed if they re wrong Common errors: Incorrect time zone interpretation Host clock incorrect

Past, present, future 12 If this search ever returns events, you have timestamp problems 1 : index=* earliest=+30m latest=+9y This requires some tweaking, depending on your expected delay: index=* eval delta=_indextime- _time where delta>300 1 Or a flux capacitor 2 2 Or a TARDIS

13 red card your approximate wait time is

Calculate average delay proxy logs 14 index=main eval delta = _indextime - _time timechart span=1h avg(delta) Problem: that s a lot of events

15

16 Calculate average delay proxy logs Solution: */5 * * * * wget http://testdomain.zzz index=main testdomain.zzz eval delta = _indextime - _time timechart span=1h avg(delta) Search terms index=main index=main testdomain.zzz Duration 453 s 6 s

17 watchlists better than grep -f

Watchlist examples 18 Known evil IP addresses Known evil domain names List of your DMZ web servers Known allowed IP/port combinations in your DMZ

Example IP watchlist 19

20 Conventional way to use watchlists This is essentially grep -F

21 Let s try a subsearch

22 What s the difference? Both return the same events

23 What s the difference? 71% less time

Saving time on a search can be important for large or frequent searches 24 Small watchlists and large datasets make this difference greater

How does it work? 25 Just the subsearch

26 Subsearches implicitly end with format Add it explicitly to see what s happening

sourcetype=access_combined_wcookie [ inputlookup ip_watchlist.csv search type=malicious fields clientip ] 27 after the subsearch is evaluated becomes this: sourcetype=access_combined_wcookie ( ( clientip="131.178.233.243" ) OR ( clientip="212.58.253.71" ) OR ) i.e., the results of the subsearch are appended

28 The Search Job Inspector shows us this.

29 Why is sourcetype=access_combined_wcookie ( ( clientip="131.178.233.243" ) OR ( clientip="212.58.253.71" ) OR ) Better than sourcetype=access_combined_wcookie lookup ip_watchlist.csv clientip search type=malicious

30 Search Job Inspector explains it all

This icon means there s some debugging message you should examine 31 Inspect Job is always here

32

33 Profiling information Debugging message

34 The slowest parts of a Splunk search are usually field extraction and reading events from disk.

Approximate order of operations for searches 35 1. Search index for keywords 2. Read matching events from disk 3. Extract fields (as necessary) 4. Match keywords to fields (as necessary) 5. Filter (e.g. additional where or search pipes) 6. Send data to search head

What are keywords? 36

37 A stitch in time saves nine lookup subsearch 2 21 Check index for keywords 39,000 2,700 Read matching events from disk 39,000 2,700 Extract fields (i.e. regex) 39,000 2,700 Match keywords to fields 39,000 2,700 Filter * This is illustrative and approximate, not precise Pare your data early to save time late

lookup method reads and regexes all this data 38 sourcetype=access_ combined_wcookie ( ( clientip="131.178.2 33.243" ) OR ( clientip="212.58.253. 71" ) OR ) subsearch method reads only this data

Compare lookup and subsearch methods 39

40 More fun with subsearches

Field name mismatch with subsearch 41 For lookup and subsearch, sometimes fields need to be renamed lookup method lookup watchlist.csv foo AS bar subsearch method [ inputlookup watchlist.csv rename foo AS bar ]

42 If you rename a field to query, you can search anywhere in the event rather than a single field

Large subsearches 43 If your watchlist is >10000 lines, the subsearch method chokes 43

Large subsearches 44 Add format explicitly to fix it! Warning is gone We have events 44

45 carrier signal

What s the problem with watchlists? 46 When they don t alert, is it because: the watchlist is broken? there s nothing to alert on?

Add test cases to your watchlist 47 Label your test domain as type=test in the watchlist And adjust your subsearch accordingly

Add test cases to your watchlist 48 Label your test domain as type=test in the watchlist What s so great about that? We could have just used google.com for that test And adjust your subsearch accordingly

49 With your wget, you know precisely how many to expect and you can alert only when it s erroneous

50 imaginary events we landed on the moon

51 Creating data on the fly

How is this helpful? 52 You can add to a watchlist inline

Creating data on the fly with timestamps 53 This will also provide a current timestamp 53

54 Are we there yet?

Overall lessons 55 Read Splunk Search Manual Try multiple methods Use the Job Inspector Understand what Splunk is doing under the hood

56 Thank you!