timestampsplunkadjustment

Splunk - Adjusting source file timestamp


Given:

Problem: After ingesting each of the log files, the events are off by 13 seconds (obviously).

Question: Can I adjust the _time for all events in source=file_2 by 13 seconds so the events line up correctly in search results, graphs, etc.?

(Note: this is a simple break down of the more complex problem. I have thousands of logs from hundreds of servers. I cannot simply re-run/create these logs.)


Solution

  • You can do set the Splunk timestamp to whatever you want simply be overwriting the _time field for those events:

    <any base search> source=file_2  | eval _time=_time+13
    

    We can use an eval if statement to view all events and update the time only for file_2

    <any base search> | eval _time=if(source=="file_2", _time+13, _time)