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!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...