Splunk Search

How to shift a timechart's bucket span=1d to start at a point other than 12AM?

asherman
Path Finder

Hi, I want to use Timechart to track daily use, but sometimes the daily data won't arrive until 12 AM (time to compile the results). How can I shift the span=1d in timechart to start at a point other than 12AM?

E.g., :

index=usage | eval time=time/3600 | timechart span=1d sum(time) as total_time by user

Thanks

Tags (3)
0 Karma

lguinn2
Legend

This is not a problem of the Splunk search - it is a problem of the timestamp of the data that you are putting into Splunk. If you write a script that tallies the number of jobs on a server, the timestamp of that event should be the date of the jobs not the time when you ran the tally.

So if if your script runs at midnight on Friday, December 5th, 2014, the output of the script should be

12-4-2014 11:59:59 number_of_jobs=2702 

or something similar. Then when you index that data, the timestamp will be correct and the data will appear on the right day.

0 Karma

somesoni2
SplunkTrust
SplunkTrust

What is your requirement here, means what do you want to measure and how it's affected due to late data arrival?

0 Karma

asherman
Path Finder

I want to represent the daily usage of a computer farm, as well as weighted priority, and so on. To reduce strain on the farm, I tally up all the days jobs at the end of the day (rather than constantly polling for new jobs/status/runtime throughout the day). This process takes variable time based on the number of jobs run over the course of the day, so to get an accurate count from 12AM->12AM (1 day), the data won't arrive until the next day, meaning all my data will be offset by one day because of when it arrives.

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Does the data comes daily once between 12:00 AM to 2:00 AM only? Means if that's the case you can just adjust _time value to adjust for the delay (reduce 7200).

0 Karma

asherman
Path Finder

In the general case, yes that's true.

To me, this seems an odd feature to be missing via option. For example, I might want the day's bucket to be based on the working day, or the year's bucket to be based on the school year, and so on.

Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...