Splunk Search

regular expression help

rajgowd1
Communicator

Hi,
i am trying to get metric and respective values using regex

can you help us to get corresponding metrics and values like
Misc:NUM_PROCS = 183
Misc:NUM_ZOMBIES=0
Procs:Waiting=0

0 Karma
1 Solution

somesoni2
Revered Legend

Since your logs is json and/or has key-value pair, the fields name and value should already be extracted. To list them try something like this

your base search | eval {name}=value | table _time  "HealthCheck|*" | rename "HealthCheck|*" as *

To chart the values (choose a aggregation function to use e.g. avg, max, min etc. The example uses avg)

your base search | eval {name}=value | table _time  "HealthCheck|*" | rename "HealthCheck|*" as * 
| timechart avg(*) as *

View solution in original post

0 Karma

somesoni2
Revered Legend

Since your logs is json and/or has key-value pair, the fields name and value should already be extracted. To list them try something like this

your base search | eval {name}=value | table _time  "HealthCheck|*" | rename "HealthCheck|*" as *

To chart the values (choose a aggregation function to use e.g. avg, max, min etc. The example uses avg)

your base search | eval {name}=value | table _time  "HealthCheck|*" | rename "HealthCheck|*" as * 
| timechart avg(*) as *
0 Karma
Get Updates on the Splunk Community!

New Year, New Changes for Splunk Certifications

As we embrace a new year, we’re making a small but important update to the Splunk Certification ...

[Puzzles] Solve, Learn, Repeat: Unmerging HTML Tables

[Puzzles] Solve, Learn, Repeat: Unmerging HTML TablesFor a previous puzzle, I needed some sample data, and ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...