search index="test" series_name=2* | rename series_name AS series| stats count AS "#" by series
I also changed your stats count(series) by series to just stats count by series because the whole count(foo) by foo thing is redundant and a little weird. Normally when you see count(foo) in someone's search it's being a little misused and can be simplified in this way.
count(foo) is often used where count would suffice. And it's also sometimes even misinterpreted as "count the distinct values of foo", although of course that's distinct_count(foo) or more commonly, dc(foo).
What count(foo) does in english is "count the number of incoming rows that have any non-null value for the foo field". Now returning to stats count(foo) by foo you'll see that it's a little nonsensical and always will be the same as count by foo. Might as well save yourself the typing and save someone else down the road the potential misunderstanding.