Splunk Search

Time picker seems to be overriding earliest=-24, any suggestions?

splunkzilla
Explorer

Hello all!  Newbie here so please forgive the ignorance in advance!

I have a search:

index="zscaler" reason="Reputation block outbound request: malicious URL"
|dedup _time
|stats count as siteCount by url,user
|where siteCount > 3
|search earliest=-24h

When running this search in the search bar, the time picker is overriding the 24 hour search criteria, which from what I read in the documentation shouldn't occur (unless it's a subsearch).  I'm using this for alerting purposes so I want to be sure to specify the time frame I'd like to search.  Any suggestions? 

 

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The earliest keyword overrides the time picker only if it is before the first pipe (|).

The command search earlies=-24h makes no sense in this query because there is no _time field to check.  The stats command discarded all but the siteCount, url, and user fields.  What is the goal of that command?

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

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

The earliest keyword overrides the time picker only if it is before the first pipe (|).

The command search earlies=-24h makes no sense in this query because there is no _time field to check.  The stats command discarded all but the siteCount, url, and user fields.  What is the goal of that command?

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

splunkzilla
Explorer

Once I moved the "earliest" command to the beginning of the query, it worked perfectly.  Thank you!

0 Karma

splunkzilla
Explorer

Ah, good to know about the earliest command, thank you!

The overall goal is to find more than 3 outbound connections to a known bad URL within a 24 hour period.  We had an issue where there were multiple connection attempts from a single user that had identical timestamps. That's the reason for the dedup portion of the query. 

For the "earliest=-24" portion of the query, we had issues where there the alert showed connection attempts over hours and/or days, so I wanted to set a time constraint. 

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...