Splunk Search

need help to find the matching values from two different queries

pench2k19
Explorer

Hi Team,

I have two queries having different count and i want to calculate the percentage of success using the two queries.

query 1: | inputlookup ConsumerSORsDetail.csv |dedup "Process Name" |rename "Process Name" as SOR|stats count as total_sor

query 2: index=bp_ede_om_consumer |rex field=source "cnapp_src_(?P[^.]*)\/log" | rex field=source "(?\d{4}-\d\d-\d\d-\d\d-\d\d-\d\d)(?[0-9]+)" |stats count as actual_sor

the query has 10 results and the query has 7 results . i want to find the percentage. can you guys please help

@vnravikumar @jkat54

Tags (1)
0 Karma

harishalipaka
Motivator

hi @pench2k19

try like this ..

| inputlookup ConsumerSORsDetail.csv |dedup "Process Name" |rename "Process Name" as SOR|stats count as total_sor |appendcols [search index=bp_ede_om_consumer |rex field=source "cnapp_src_(?P[^.]*)\/log" | rex field=source "(?\d{4}-\d\d-\d\d-\d\d-\d\d-\d\d)(?[0-9]+)" |stats count as actual_sor] |eval percentage=(actual_sor/total_sor)*100
Thanks
Harish
0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...