Splunk Search

Could someone help me on a transpose header field

jip31
Motivator

hi

I transpose header field time like this

 

 

| eval time=strftime(_time,"%H:%M")
| sort time
| fields - _time _span _origtime _events
| fillnull value=0
| transpose header_field=time 0 column_name=KPI include_empty=true
| sort KPI

 

 

Now I need to display only the fields for which _time is < to the current time

So I am doing this and it works

 

 

| where _time < now() 

 

 

 But I also need to disply only the fields an hour earlier to the current time

So I need something like this but I dont succeed

 

 

| where _time < now() AND _time > now()-1

 

 

Could you help please?

Labels (1)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| where _time < now() AND _time >= now()-3600

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

_time and now() are in seconds so 1 hour ago is now()-3600 that is 60 seconds times 60 minutes

0 Karma

jip31
Motivator

OK

| where _time < now() alone works

But  _time=now()-3600 return any time fields

What I need is something like this

| where _time < now() AND _time=now()-3600 in order to display only the fields _time between 15h and 16h (considering the current time is 16)

jip31_0-1651068447445.png

instead this

jip31_1-1651068484956.png

 

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| where _time < now() AND _time >= now()-3600
0 Karma

jip31
Motivator

perfect thanks

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

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