Splunk Search

Help creating a table that shows unique events from last 24hrs, that have not occurred within the last 30days

JAvnaim
Explorer

Hello,

I have an index with ALPR (license plate) data. I'd like to create a table, that shows unique plates detected within the last 24hrs, that were not previously detected within the last 30 days. I tried using the search below, however, it's not returning the desired results.
I think it's because I have not indicated which field to search on (in this case, it would be Plate).

Any help would be greatly appreciated. Thanks!

index="alpr_logs" source="http:openalpr" Is_Parked=False earliest=-1d latest=now NOT [search index="alpr_logs" source="http:openalpr" Is_Parked=False earliest=-30d latest=-1d] | table Plate Region Color Make Model Year
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Your suspicion is correct. The subsearch needs to be more specific about what it returns.

index="alpr_logs" source="http:openalpr" Is_Parked=False earliest=-1d latest=now NOT 
  [ search index="alpr_logs" source="http:openalpr" Is_Parked=False earliest=-30d latest=-1d | fields Plate | format ] 
| table Plate Region Color Make Model Year
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Your suspicion is correct. The subsearch needs to be more specific about what it returns.

index="alpr_logs" source="http:openalpr" Is_Parked=False earliest=-1d latest=now NOT 
  [ search index="alpr_logs" source="http:openalpr" Is_Parked=False earliest=-30d latest=-1d | fields Plate | format ] 
| table Plate Region Color Make Model Year
---
If this reply helps you, Karma would be appreciated.

JAvnaim
Explorer

This worked great; thank you!

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 ...