Splunk Search

How to add time parameter in query

tkadale
Path Finder

How to search something for specific time period. For example I want to show Max CPU usage for each host for Last 24 hours. And want to do it through query and don't want to use TimeRangePicker. Can anybody Help??

Thanks in Advance!

Tags (1)
0 Karma

Ant1D
Motivator

You should be able to this. Here's an example:

index=myindex earliest=-24h

This will return all events in the index named myindex in the last 24 hours. You just need to add the parameter earliest=some_time_period as shown above

0 Karma

fox
Path Finder

search earliest=-24h should do the trick - there is good documentation on this and other time commands in the search pdf file downloadable from the splunk website.

0 Karma
Get Updates on the Splunk Community!

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...