Splunk Search

Display ticket status and count

nischal45
Engager

Need help with a query please:
I have ticket data where the life cycle is Assigned, Work in Progress, Fixed, Closed and the ticket is assigned to our group ABC. I want to display only the tickets which are assigned and in progress to our group ABC.

My end goal is to show ABC group's ticket count which are not fixed and closed. I have the below query so far:

TICKET         STATUS                         GROUP
TIC12345   Assigned                        ABC
                       Work in Progress         ABC
                       Fixed                                DEF
                      Closed                              DEF

index=* source=* group=ABC
| stats latest(status) as l_status latest(group) as l_group by TICKET
| search NOT l_status in("Fixed", "Closed")

Result:
TICKET          STATUS                  GROUP
TIC12345  Work in Progress   ABC

I was able to get the data however, I'm also getting ticket which are closed(because it is initially assigned to ABC and later it was closed by DEF). Appreciate your help! 

Labels (3)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

If more than one group can work on a ticket then the group name cannot be in the base query.  Filter by group name after filtering on status.

index=foo source=bar
| stats latest(STATUS) as STATUS, latest(GROUP) as GROUP by TICKET
| search STATUS IN ("Assigned", "Work in Progress") AND GROUP="ABC"
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

If more than one group can work on a ticket then the group name cannot be in the base query.  Filter by group name after filtering on status.

index=foo source=bar
| stats latest(STATUS) as STATUS, latest(GROUP) as GROUP by TICKET
| search STATUS IN ("Assigned", "Work in Progress") AND GROUP="ABC"
---
If this reply helps you, Karma would be appreciated.
0 Karma

nischal45
Engager

I agree but the amount of data i’m dealing with is in millions and was trying to save some computing power.

Do you think this query would take lot of processing power if  i’m searching for ~11 months of  data.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

I understand wanting (or needing) to reduce the number of events looked at, but we shouldn't throw away data we need for the query to work.  How long it will take to process millions of events depends on how many indexers are doing the processing and how well distributed the data is.

---
If this reply helps you, Karma would be appreciated.
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!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...