Splunk Search

How to filter a specific time in Splunk?

sanglap
New Member

I want to perform a search query which can give me results with respective to a specific time.

For example i have a particular time as this:  2022-07-29 18:33:20

My query:

index="*" sourcetype="pan:threat" 10.196.246.104 url=*   earliest=relative_time("2022-07-29 18:33:20","-1h") AND latest = relative_time("2022-07-29 18:33:20","+1h")
| stats values(url) as url by _time,dest_ip,dest_port,app,category,rule,action,user

 

I am not getting appropriate results with this, can anyone suggest how i can do the filtration on the basis of a particular time.

Labels (1)
Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
index="*" sourcetype="pan:threat" 10.196.246.104 url=* 
[| makeresults
 | eval earliest=relative_time("2022-07-29 18:33:20","-1h")
 | eval latest = relative_time("2022-07-29 18:33:20","+1h")
 | fields earliest latest]
| stats values(url) as url by _time,dest_ip,dest_port,app,category,rule,action,user
0 Karma

jamie00171
Communicator

Hi @sanglap 

Can you just provide the time like:

earliest="2022-07-29:18:33:20" latest="2022-07-29:18:34:20"

There are some examples here: https://docs.splunk.com/Documentation/SCS/current/Search/Timemodifiers#Examples

Thanks, 

Jamie

 

 

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...