Splunk Search

CLI ignoring my time limit

glsplunk
New Member

I've been trying variations of this:

/opt/splunk/bin/splunk search "10.3.16.31" -latest_time '-4h@h'

but it doesn't limit things -- i get everything going back to
year zero. what am i doing wrong?

Tags (1)
0 Karma

glsplunk
New Member

http://docs.splunk.com/Documentation/Splunk/5.0.3/SearchReference/CLIsearchsyntax
is where i saw -latest_time.

i am a newbie at the CLI.

w/ apostrophes as you show them, i get no output at all.

w/ quotes instead of apostrophes, i get no output.

w/ nothing i get no limits -- everything since time 0.

0 Karma

lguinn2
Legend

Where did you find "-latest_time" - I don't see that it is a valid term. Also, if it worked, it would specify the ending time, not the beginning time - so the search would start at the beginning of time and end 4 hours ago. I don't think that is what you want.

I would do it like this

/opt/splunk/bin/splunk search "10.3.16.31 earliest=-4h@h"

or

/opt/splunk/bin/splunk search "10.3.16.31" -earliest_time '-4h@h'
0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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