Splunk Search

How can I run a windowed realtime seach from the command line?

jrodman
Splunk Employee
Splunk Employee

I can run a search from the command line with time boundaries as earliest= and latest= as part of my search. And I can run a realtime search over all time from the command line using 'rtsearch'.

But if I try to run a realtime search with earliest= and latest= keywords as part of the search string, they aren't effective. How can I make this work?

Tags (1)
1 Solution

Rob
Splunk Employee
Splunk Employee

Using 'earliest' and 'latest' may not work as mentioned in the following splunk answer:

http://splunk-base.splunk.com/answers/40885/querying-a-real-time-search#71382

Try using the following:

bin/splunk rtsearch 'index=_internal -earliest_time 'rt-30s'  -latest_time 'rt+30s'

-earliest_time and -latest_time should set the same-name arguments in the REST API.

View solution in original post

Rob
Splunk Employee
Splunk Employee

Using 'earliest' and 'latest' may not work as mentioned in the following splunk answer:

http://splunk-base.splunk.com/answers/40885/querying-a-real-time-search#71382

Try using the following:

bin/splunk rtsearch 'index=_internal -earliest_time 'rt-30s'  -latest_time 'rt+30s'

-earliest_time and -latest_time should set the same-name arguments in the REST API.

Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...