Search This Blog

Friday, March 22, 2024

06_Splunk 9 Generating Tailored Searches

 


1 Generating Tailored Searches - Course Overview

1.1 Course Overview

2 Learning About Splunk Searching

2.1 Let’s Learn About Splunk Searching!

2.2 Reviewing Splunk Lookups

2.3 Performing Basic Searches with Lookups

2.4 Learning Additional Lookup Usage

2.5 Using Lookups in Tailored Searches

2.6 Additional Lookup Usage in Splunk

3 Using Statistical Commands

3.1 Using Splunk Statistical Commands

3.2 Stats Command Arguments

3.3 Stats Command Functions

3.3.1 Types of Stats Functions

3.3.1.1 Aggregate Functions

3.3.1.2 Event Order Functions

3.3.1.3 Multivalue Stats and Chart Functions

3.3.1.4 Time Functions

3.4 Using Statistical Calculations in Splunk

3.5 Introducing Splunk Subsearches

3.6 Using Splunk Subsearches

4 Performing Transformative Searches in Splunk

4.1 Eval Commands in Splunk

4.2 Using Eval Commands

4.3 Detailing Eval Functions

4.4 Filtering and Formatting Splunk Search Data

4.5 Wrapping up Evaluating and Filtering

5 Understanding Self-describing Data

5.1 Understanding Self-describing Data

5.2 Using Self-describing Data in Splunk

5.3 Multivalue Fields

5.4 Extracting Structured Data

5.5 Using Structured Data and Multivalue Fields

5.6 Wrapping up Self-describing Data

6 Composing Advanced Searches in Splunk

6.1 Advanced Searches

6.2 Using Transactions in Splunk Searches

6.3 Generating Tailored Searches in Splunk

6.4 Searching Efficiently in Splunk

6.5 Optimizing Splunk Searches

6.6 Wrapping up Tailored Searches in Splunk


  1. Generating Tailored Searches - Course Overview

    1. Course Overview

A black background with white text

Description automatically generated



  1. Learning About Splunk Searching

    1. Let’s Learn About Splunk Searching!

  • We collect the data and use for security and data analytics

  • Ingest the course files

  1. Reviewing Splunk Lookups

Lookup tables available in below folder – if not we can create itA black text on a white background

Description automatically generated

C:\Program Files\Splunk\etc\system\lookups

C:\Program Files\Splunk\etc\apps\search\lookups

A screenshot of a computer

Description automatically generated




  1. Performing Basic Searches with Lookups

  • Create index=pfsense from given exercise file

  • Click Add data

  • A screenshot of a computer

Description automatically generated

Choose upload

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

Choose the file

A screenshot of a computer

Description automatically generated


??? how to remove the uploaded file

Next

A screenshot of a computer

Description automatically generated


Next

Click create index - 

A screenshot of a computer

Description automatically generated




A screenshot of a computer

Description automatically generated


Click Review

A screenshot of a computer

Description automatically generated


A screenshot of a computer

Description automatically generated


Click Start Searching

A screen shot of a computer

Description automatically generated


Index=pfsense | iplocation dest


Index=pfsense | iplocation dest

index=* 

| stats count(source) by sourcetype


A screenshot of a computer

Description automatically generated


A screenshot of a computer screen

Description automatically generated



  1. Learning Additional Lookup Usage

  • If we know ip get host, if we know host get ip

  • Index=pfsense |

index=pfsense 

| table _time, dest, dest_ip 

| outputlookup rules.csv 

  • Check settings – lookup – we can see this file in app is search

A screenshot of a computer

Description automatically generated



  1. Using Lookups in Tailored Searches

A screenshot of a computer

Description automatically generated


A screenshot of a computer

Description automatically generated

A screen shot of a computer code

Description automatically generated

A close up of a web page

Description automatically generated





  1. Additional Lookup Usage in Splunk

Automated lookup

We can create lookup file by opening folder /../lookups/filename.csv and put the data – the same will be available in splunk web.  Then we need to do the lookup table definition in site


A screenshot of a computer

Description automatically generated


?? one lookup table can have multiple definitions?


Automatic lookups

A screenshot of a computer

Description automatically generated


A white background with black text

Description automatically generated






  1. Using Statistical Commands

    1. Using Splunk Statistical Commands

Good for visualization

Stats used for statistics

A green background with white text

Description automatically generated


A close-up of a black background

Description automatically generated

https://docs.splunk.com/Documentation/SplunkCloud/9.1.2308/SearchReference/SQLtoSplunk




  1. Stats Command Arguments

A screenshot of a diagram

Description automatically generated

A black and white image of a black and white image of a black and white image of a black and white image of a black and white image of a black and white image of a black and

Description automatically generated


A screenshot of a computer

Description automatically generated

A screenshot of a computer program

Description automatically generated




  1. Stats Command Functions 

    1. Types of Stats Functions 

      1. Aggregate Functions

  • Avg()

  • Count()

  • Distinct_count

  • Max()

  • Min()

  • Median()

  • Mode()

  • Range()

  • Sum()

  • Var() 

  1. Event Order Functions

A screenshot of a computer

Description automatically generated


  1. Multivalue Stats and Chart Functions

A black text on a white background

Description automatically generated


  1. Time Functions

A screenshot of a computer

Description automatically generated







  1. Using Statistical Calculations in Splunk

index=main 

| stats count by EventCode

A screen shot of a computer

Description automatically generated


A screenshot of a computer error message

Description automatically generated


index=main 

| stats avg(linecount)


??? metrics vs event

A screen shot of a computer

Description automatically generated

  1. Introducing Splunk Subsearches

Subsearch is filter narrow data – splunk first do subsearch first then do the main search

A screenshot of a computer

Description automatically generated


A white background with black text

Description automatically generated




  1. Using Splunk Subsearches

??? how I know how much time splunk takes to process search results

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

A screen shot of a computer code

Description automatically generated

A screenshot of a computer

Description automatically generated

A white rectangle with blue border with black text

Description automatically generated

This is taking more time 


Subsearch is not required it takes more resources and slow the splunk process


A screenshot of a web page

Description automatically generated





  1. Performing Transformative Searches in Splunk

    1. Eval Commands in Splunk

A black text on a white background

Description automatically generated

A white text with black text

Description automatically generated


A screenshot of a graph

Description automatically generated


A screenshot of a computer program

Description automatically generated


A screenshot of a computer function

Description automatically generated





  1. Using Eval Commands

A computer code with text

Description automatically generated

A screenshot of a computer

Description automatically generated


A close-up of a web page

Description automatically generated



  1. Detailing Eval Functions

A screenshot of a computer

Description automatically generated


A screenshot of a computer

Description automatically generated


A screenshot of a computer

Description automatically generated


A white background with black text

Description automatically generated


A close-up of a text

Description automatically generated



  1. Filtering and Formatting Splunk Search Data

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated


A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated - not  more useful 


A screen shot of a computer code

Description automatically generated


A screenshot of a computer

Description automatically generated

  1. Wrapping up Evaluating and Filtering


A screenshot of a computer

Description automatically generated


A screen shot of a computer

Description automatically generated


A screenshot of a computer

Description automatically generated




  1. Understanding Self-describing Data

    1. Understanding Self-describing Data

A close up of a black background

Description automatically generated

A screenshot of a computer screen

Description automatically generated


JSON – field: value, nested array

Unstructured data needs processing to ingesting the data

A close-up of a list of words

Description automatically generated


A white rectangular object with black text

Description automatically generated

A black text on a white background

Description automatically generated

  1. Using Self-describing Data in Splunk

JSON Format

Upload the json file with different index name as “globelzeek”

A screenshot of a computer

Description automatically generated


A screenshot of a computer

Description automatically generated


A screenshot of a computer

Description automatically generated




 

  1. Multivalue Fields

  • Data analyst works Multivalue fields all the time

  • A close-up of a sign

Description automatically generated

  • JSON will have one field with nested field and values

  • Mv

  • A white background with black text

Description automatically generated



  1. Extracting Structured Data

Spath is autoextract mode

A black and white screen with words

Description automatically generated

A screenshot of a computer

Description automatically generated

A screenshot of a computer program

Description automatically generated


Either INDEXED_EXTRACTIONS = json OR KV_MODE = JSON

A screenshot of a computer

Description automatically generated





  1. Using Structured Data and Multivalue Fields


  1. Wrapping up Self-describing Data

A screen shot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated


A screenshot of a computer

Description automatically generated


values taken from json and create new fields available in interesting fields

A close-up of a data

Description automatically generated


  1. Composing Advanced Searches in Splunk

    1. Advanced Searches


A screenshot of a computer

Description automatically generated


A green rectangle with white text

Description automatically generated

A screen shot of a computer

Description automatically generated



  1. Using Transactions in Splunk Searches

A black text on a white background

Description automatically generated


A screenshot of a web page

Description automatically generated

--


Transaction is similar to stats command

A screenshot of a graph

Description automatically generated



A close-up of a white background

Description automatically generated



  1. Generating Tailored Searches in Splunk

A screenshot of a computer

Description automatically generated


A screenshot of a computer code

Description automatically generated

A screenshot of a computer

Description automatically generated


A screenshot of a computer

Description automatically generated




  1. Searching Efficiently in Splunk

A blue background with white text

Description automatically generated

A black rectangular box with white text

Description automatically generated

A white paper with black text

Description automatically generated


A screen shot of a computer

Description automatically generated


Field discovery slows our search

A screenshot of a computer

Description automatically generated


Familiarize with Search Job Inspector


  1. Optimizing Splunk Searches

  • Filtering as soon as possible

A screenshot of a computer

Description automatically generated

A screenshot of a computer

Description automatically generated



  1. Wrapping up Tailored Searches in Splunk

A screenshot of a web page

Description automatically generated


A screenshot of a computer

Description automatically generated


No comments:

Post a Comment