Splunk Search

How to display/access parameters after grouping?

KAKA
New Member

For example I have getting splunk logs with 4 fields 

 

TimeEvent
time 1service = "service1"  | operation = "sampleOperation1" | responseTime = "10" | requestId = "sampleRequestId1"
time2service = "service2"  | operation = "sampleOperation2" | responseTime = "60" | requestId = "sampleRequestId2"
time3service = "service2"  | operation = "sampleOperation2" | responseTime = "60" | requestId = "uniqueRequestId3"
time4service = "service4"  | operation = "sampleOperation4" | responseTime = "30" | requestId = "sampleRequestId4"

 

My objective is to find from all the logs if count is greater then 20 for  combination of (service,operation) with reponseTime>40.

Expected Output

service1  operation1  [sampleRequestId2,uniqueRequestId3]

 

The query I have for now is

search here......

| stats count(eval(responseTime>60)) as reponseCount
by service, operation
| eval title= case(
                              match(service,"service2") AND reponseCount>20, "alert1",
)
| search title=*
| table title,service

 

But here I cannot refer to requestId which is being dropped. Please suggest if you any solution.

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try this:

| eventstats count(eval(responseTime>40)) as responseCount
by service, operation
| where responseCount > 20 AND responseTime > 40
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

SOK it to Me: Top 3 Benefits of Using Splunk Operator on Kubernetes that’ll Make ...

    Thursday, July 9, 2026  |  11:00AM–12:00PM PDT Duration: 1 hour (includes Q&A) Managing can feel like a ...

Upgrade Prep for 10.4, Network Observability Deep Dives, and More from Splunk Lantern

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

Splunk Developer Day announcements: AI agents, MCP tools, Forecasting, and Custom ...

Splunk Developer Day was packed with product and platform updates for developers building in the AI ...