I have the following Splunk search that gathers the different Statuses from my dataset:
some type of search | eval Status = (REJECT_REASON) | bucket _time span=day | stats count by Status
This is a sample how my dataset looks:
CorrelationId Reject_Reason DATE_TIME
12345679 Accepted 20231030 14:00:00
12345679 Accepted 20231030 14:00:00
12345679 Accepted 20231030 14:00:00
12345679 Sent 20231030 00:00:00
12345679 Sent 20231030 00:00:00
12345679 Sent 20231030 00:00:00
99399394 Rejected 20231030 00:00:00
99399394 Rejected 20231030 00:00:00
88393933 Accepted 20231030 14:00:00
88393933 Sent 20231030 00:00:00
33454545 Rejected 20231030 00:00:00
I would like to only get statuses for the distinct correlationId's, meaning that with the sample dataset I would only get back a count for 4 correlationId's and the statuses that are the latest date.
Example of desired result:
Status Count
Accepted 2
Rejected 2
I have tried using "dedup correlationId" but it returned no results when I added that on to the search.
Based on the latest (as of Nov 1st) requirements below is my query: