Knowledge Management

Count multi value field in Data Model

guimilare
Communicator

Hello Splunkers.

I have a data model that contains a multi value field, called acao.
Looking at the data model, I have the following:

alt text

When I run the following query: | tstats count(DM.acao) from datamodel="My_DataModel", the result is 2.
However, I want it to count all occurrences, resulting in 8 (1 P and 7 X's).

How can I do this?

Thanks.
Best Regards,
GMA

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

HI @guimilare,

Can you please try this?

| tstats count from datamodel="My_DataModel" by DM.acao | stats sum(count) as count

Thanks

0 Karma

Ayn
Legend

| tstats dc(DM.acao)?

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...