Splunk Search

Why is my search returning a different set of results after I replaced the 'dedup' command with 'stats dc()' to improve performance?

IRHM73
Motivator

Hi,

I wonder whether someone may be able to help me please.

I'm using the search below to successfully produce a given group of stats:

auditSource=ts auditType=RenewalStarted NOT [search auditSource=ts auditType=RenewalCompleted | table detail.nino] |
iplocation tags.clientIP |dedup detail.nino | fillnull value="Country Not Found" Country | stats count by Country

Because I know that the dedup command can be resource intensive, I've tried changing this by using the stats dc command as below:

auditSource=ts auditType=RenewalStarted NOT [search auditSource=ts auditType=RenewalCompleted | table detail.nino] |
iplocation tags.clientIP | fillnull value="Country Not Found" Country | stats dc(detail.nino) By Country

The problem I have is that although I'm using the same date period, the search is not returning the same set of results.

I just wondered whether someone may be able to look at this please and offer some guidance on where I may have gone wrong.

Many thanks and kind regards

Chris

0 Karma
1 Solution

IRHM73
Motivator

Hi thank you for coming back to me. When I omit the fillnull from the second query the number of events are still greater than the initial query and the count significantly reduced.

However If I changed the latter query to auditSource=tc auditType=TCStarted NOT [search auditSource=tc auditType=TCCompleted | table detail.nino] | iplocation tags.clientIP | fillnull value="Country Not Found" | stats dc(detail.nino) By Country which is now working perfectly.

Kind regards

Chris

View solution in original post

0 Karma

IRHM73
Motivator

Hi thank you for coming back to me. When I omit the fillnull from the second query the number of events are still greater than the initial query and the count significantly reduced.

However If I changed the latter query to auditSource=tc auditType=TCStarted NOT [search auditSource=tc auditType=TCCompleted | table detail.nino] | iplocation tags.clientIP | fillnull value="Country Not Found" | stats dc(detail.nino) By Country which is now working perfectly.

Kind regards

Chris

0 Karma

woodcock
Esteemed Legend

Is it the same without the fillnull command?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...