Getting Data In

timechart sum the total results of a query and have individual values too.

jperezes
Path Finder

Hi and thanks in advance,

I am trying to get a dashboard to get the total number of calls, the call types and the users who placed the calls

if I count by callType I get each call type then I pipe by addtotals, so I get the first two stats, but how then I can do something like dc(filterUserName)

| timechart span 1d count by typeOfCall | addtotals | dc(userNames)

last dc(userNAmes) returns an error.

thx,

Juan

Tags (1)
0 Karma

somesoni2
Revered Legend

Try something like this

your base search | timechart span=1d count dc(userNames) as Users by typeOfCall | addcoltotals

This should give you distinct user count for each day by each typeOfCall.

0 Karma

Richfez
SplunkTrust
SplunkTrust

Try this:

... | bin span=1d | stats dc(userNames) as DistinctUserCount count as OverallCount by typeOfCall | addtotals 

I've rearrange things a bit to ...
Drop things into bins of 1d each.
Create some statistics, like the one you want - there are lots more to do if you want.
Then do your addtotals and whatnot.

Note you didn't use the "code" button to format that, so I only hope it all came through. (It looks like a fine search, so it probably did)

0 Karma

jperezes
Path Finder

Hi rich7177,

Thanks for your quick response I tried your command and I got the error bin need a field to discretize, so I added ... | bin _time span=1d|....

The issue I face with this solution is the addtotals at the end adds different fields like typeOfCall with DistinctUserCount to the total metric. I would need to sum only the total calls placed.

Kind Regards,
Juan

0 Karma

Richfez
SplunkTrust
SplunkTrust

Oh, good catch, sorry to have forgotten _time in there...

If you only need addtotals to add certain fields, just specify them. In the example case I wrote, that would be
... | addtotals OverallCount

0 Karma
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...