You should use stats in a slightly different manner. The problem is that you are now grouping by a field that will have different values, namely the recDate .
Instead you should only group by the first two, and just attach the lowest/earliest value of date for every combination of filingType and application , along with the count. If your recDate is in the format you specify you may need to alter that a bit for sorting purposes.
Alternative A (this assumes that events you have came in chronologically, which makes the last retrieved event have the earliest recDate - remember that a search always returns the newest events first);
...| stats c last(recDate) as recDate by filingType, application
Alternative B (which may be just as good, though just a little longer query);
...| eval rd = strptime(recDate, "%Y-%m-%d") | stats c min(rd) as recDate by filingType, application | eval recDate = strftime(recDate, "%Y-%m-%d")
This converts the date string into epoch for each event, which makes it easy to find the min() of that. Then it's converted back to a string for presentation purposes.
EDIT: typos and errors
Hope this helps,
Kristian
... View more