Can promtail count the categories?

Hello all,
Is there a simple method to count the categories by promtail; log as blow;I want to know the count of dataset categories, but the count metric seems can’t get it
dataset1 200 …
dataset2 200 …
dataset3 200 …
dataset2 200 …
dataset4 200 …