Dashboards & Visualizations

I want to plot a single graph for two different searches .

jsamadhan
New Member

I am running two search queries-

1st to get count of requests received -
"Received Request-ID-->" | rex ">(?\S+) " | eval Application=case(areqstat LIKE "BTMS%","BTMS",areqstat LIKE "EVSN%","EVSN_Application",areqstat LIKE "DFLW%","DFLW_Application",areqstat LIKE "IDAP%", "IDAP Application",areqstat LIKE "ISF%","ISF Application",areqstat LIKE "ROLB%", "ROLB", 1=1, "Other") | stats count by Application

2nd to get count of responses sent -
Response_for_Request="Response sent for request Id" | rex "request Id - (?\S+) " | eval Application=case(areqstat LIKE "BTMS%","BTMS",areqstat LIKE "EVSN%","EVSN_Application",areqstat LIKE "DFLW%","DFLW_Application",areqstat LIKE "IDAP%", "IDAP Application",areqstat LIKE "ISF%","ISF Application",areqstat LIKE "ROLB%", "ROLB", 1=1, "Other") | stats count by Application

I want to plot a single graph where request received vs response sent count can be plotted for same application.

Any suggestion?

Tags (1)
0 Karma
1 Solution

somesoni2
Revered Legend

Try like this

("Received Request-ID-->") OR (Response_for_Request="Response sent for request Id") 
| rex "\>(?<areqstat1>\S+) " | rex "request Id - (?<areqstat2>\S+) " | eval areqstat=coalesce(areqstat1,areqstat2) 
| eval Application=case(areqstat LIKE "BTMS%","BTMS",areqstat LIKE "EVSN%","EVSN_Application",areqstat LIKE "DFLW%","DFLW_Application",areqstat LIKE "IDAP%", "IDAP Application",areqstat LIKE "ISF%","ISF Application",areqstat LIKE "ROLB%", "ROLB", 1=1, "Other") 
| eval type=if(searchmatch("Received Request-ID-->"),"received_count","sent_count")
| chart count over Application by type

View solution in original post

0 Karma

somesoni2
Revered Legend

Try like this

("Received Request-ID-->") OR (Response_for_Request="Response sent for request Id") 
| rex "\>(?<areqstat1>\S+) " | rex "request Id - (?<areqstat2>\S+) " | eval areqstat=coalesce(areqstat1,areqstat2) 
| eval Application=case(areqstat LIKE "BTMS%","BTMS",areqstat LIKE "EVSN%","EVSN_Application",areqstat LIKE "DFLW%","DFLW_Application",areqstat LIKE "IDAP%", "IDAP Application",areqstat LIKE "ISF%","ISF Application",areqstat LIKE "ROLB%", "ROLB", 1=1, "Other") 
| eval type=if(searchmatch("Received Request-ID-->"),"received_count","sent_count")
| chart count over Application by type
0 Karma

cmerriman
Super Champion

if you can have the base search have both sourcetypes/indexes, i'd suggest putting this all in one search. write an eval that says if it is received or sent using the source or field that would tell you that. ie: |eval type=if(index=isnotnull(Response_for_Request),"sent","received") and then |stats count by Application type

0 Karma
Get Updates on the Splunk Community!

Your Guide to Splunk Digital Experience Monitoring

A flawless digital experience isn't just an advantage, it's key to customer loyalty and business success. But ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...