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!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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