Splunk Search

How can I join these two tstats searches

tkw03
Communicator

The searches look like this in their base form

 

| tstats count where index=nix_os earliest=07/10/2020:00:00:00 latest=07/10/2020:23:59:59 by host
| tstats count where index=nix_os earliest=07/09/2020:00:00:00 latest=07/09/2020:23:59:59 by host

 

 

I was trying something like this but I can't seem to get it just right:

 

| tstats count where index=nix_os earliest=07/09/2020:00:00:00 latest=07/09/2020:23:59:59 by host
[| tstats append=true count where index=nix_os earliest=07/10/2020:00:00:00 latest=07/10/2020:23:59:59 by host prestats=true 
| stats count as newhost by host]

 


My goal is to find hosts that were not logging on the 9th that started on the 10th

 

thanks for the help!

Labels (4)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The append command works.

 

| tstats count where index=nix_os earliest=07/09/2020:00:00:00 latest=07/09/2020:23:59:59 by host
| append [| tstats count where index=nix_os earliest=07/10/2020:00:00:00 latest=07/10/2020:23:59:59 by host prestats=true 
| stats count as newhost by host]
| stats values(*) as * by host

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The append command works.

 

| tstats count where index=nix_os earliest=07/09/2020:00:00:00 latest=07/09/2020:23:59:59 by host
| append [| tstats count where index=nix_os earliest=07/10/2020:00:00:00 latest=07/10/2020:23:59:59 by host prestats=true 
| stats count as newhost by host]
| stats values(*) as * by host

 

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Detecting Brute Force Account Takeover Fraud with Splunk

This article is the second in a three-part series exploring advanced fraud detection techniques using Splunk. ...

Buttercup Games: Further Dashboarding Techniques (Part 9)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Buttercup Games: Further Dashboarding Techniques (Part 8)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...