This may be slightly off, because I've never use this datatype myself, but I believe this is why you're seeing the results you described above:
sourcetype=log4j ERROR | eval warns=errorGroup+"-"+errorNum
| top warns by errorDesc
| stats stdev(count), var(count) by warns
You're asking for the stdev / var of the number of events. The number of events is always going to be a single value.
When I remove "| top warns by errorDesc" The succeding search displays
nothing accept the first column values for "warns". Nothing for stdev(count) or var(count)
If you remove "top warns by errorDesc" then the count field is never generated, so there's nothing to perform statistics on.
sourcetype=log4j ERROR | eval warns=errorGroup+"-"+errorNum
| top warns by errorDesc
| stats stdev(count), var(count)
That is returning data -- specifically the stdev and the var between the top types of errors. In essence, the first one, you're looking at the stdev of the count for a particular warn. For the last one, you're looking across all the warns. So if you had 10 types of warns, all occurred 1 time, and one occurred 30 times, the stdev would be 9.17 (at least, according to my web calculator).
BTW: You might also find value in the following, related search (and because that's the direction I thought you were heading in, and started writing it before I re-read your original post):
sourcetype=log4j ERROR earliest=-7d@d latest=@d | eval warns=errorGroup+"-"+errorNum
| stats count as Date_Warns_Count by date_mday,warns
| stats stdev(Date_Warns_Count), var(Date_Warns_Count) by warns
That's similar to your first one, except it will provide you the stdev, var of the daily count, per warn.
Hope this is helpful.
... View more