Dashboards & Visualizations

Include present time while adding time to the event

MeMilo09
Path Finder

Hello Splunk Community,

I would like to add time to an event, but at the same time keep the present time. So, start with present time and also add one day to the event... Below I have the concept, but I still need some guidance on how to include present time results while also adding one day to the event. Any advise out there? 

 

| makeresults
| eval start_time=relative_time(_time,"-1d@d")
| eval end_time=start_time+3600*24 + 1
| eval the_time=mvrange(start_time, end_time, 3600)
| mvexpand the_time
| rename the_time as _time
| table _time

 

Tags (1)
0 Karma
1 Solution

scelikok
SplunkTrust
SplunkTrust

Hi @MeMilo09,

I am not sure about your need about the present time, but please try below? It will add current time to the list;

| makeresults
| eval start_time=relative_time(_time,"-1d@d")
| eval end_time=start_time+3600*24 + 1
| eval the_time=mvrange(start_time, end_time, 3600)
| eval present_time=strftime(now(),"%s")
| eval the_time=mvappend(the_time,present_time)
| mvexpand the_time
| rename the_time as _time
| table _time
If this reply helps you an upvote and "Accept as Solution" is appreciated.

View solution in original post

0 Karma

scelikok
SplunkTrust
SplunkTrust

Hi @MeMilo09,

I am not sure about your need about the present time, but please try below? It will add current time to the list;

| makeresults
| eval start_time=relative_time(_time,"-1d@d")
| eval end_time=start_time+3600*24 + 1
| eval the_time=mvrange(start_time, end_time, 3600)
| eval present_time=strftime(now(),"%s")
| eval the_time=mvappend(the_time,present_time)
| mvexpand the_time
| rename the_time as _time
| table _time
If this reply helps you an upvote and "Accept as Solution" is appreciated.
0 Karma
Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...