Splunk Search

How to add hours to _time for specific events using eval?

kevinjacks
Explorer

I need to add 3 hours to records which have SITE=1 and not change anything for other sites.

I started with this, but I can't figure out how to incorporate that into an IF statement.

| eval _time=_time+10800
Tags (3)
0 Karma
1 Solution

dkoops
Path Finder

This should probably work:

| eval _time=if(SITE==1, _time+10800, _time)

View solution in original post

dkoops
Path Finder

This should probably work:

| eval _time=if(SITE==1, _time+10800, _time)

kevinjacks
Explorer

worked perfect, thank you!

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...