Splunk Search

Why is my stats count by command missing number of result?

phamxuantung
Communicator

Hello,

I have a csv file that have 209,946 rows of event as show

phamxuantung_0-1659934357176.png

 

After some query to apply some condition, as

|inputlookup VCCS_VIB.csv
|eval TIME = strptime(Time,"%H:%M %d/%m/%Y")
|where TIME>=1656090000 AND TIME<=1659286800
|stats count by TYPE NAME CMND CARDNUM

The meaning is I want to find events that between 25/6 and 31/7 and filter out duplicate row that match NAME, CMND and CARDNUM.

The query above show 207,460 events (note that all events are between the time constrain), when I order the count column, it show

phamxuantung_1-1659934357227.png

 

So there are only two duplicate row -> the final number of row should have been 209,946 - 2 = 209,944, not 207,460. There are over two thousand events missing somewhere.

Could anyone show me?

Labels (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

What do you get if you try this?

|inputlookup VCCS_VIB.csv
|eval TIME = strptime(Time,"%H:%M %d/%m/%Y")
|where TIME>=1656090000 AND TIME<=1659286800
|fillnull value="NA"
|stats count by TYPE NAME CMND CARDNUM

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

What do you get if you try this?

|inputlookup VCCS_VIB.csv
|eval TIME = strptime(Time,"%H:%M %d/%m/%Y")
|where TIME>=1656090000 AND TIME<=1659286800
|fillnull value="NA"
|stats count by TYPE NAME CMND CARDNUM

phamxuantung
Communicator

Ah yes, I forgot stats count doesn't count null value.

Thank you.

0 Karma
Get Updates on the Splunk Community!

Extending Splunk AI Assistant for SPL to Splunk Enterprise customers!

Howdy Splunk Community! It’s an exciting day here at Splunk – Splunk AI Assistant for SPL version 1.3.0 is now ...

Developer Spotlight with Qmulos

Qmulos: Building a Next-Level Cybersecurity Business through Splunk Apps Qmulos started as a scrappy startup ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Enhance Security Operations with Automated Threat Analysis in the Splunk EcosystemAre you leveraging ...