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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...