Splunk Search

How to create new field?

mananzeh
New Member

how can solve this ::: (Create a new field called "StartTime" and set the value to seven days ago from today, snapped to the beginning of the day) ???

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Use the eval command to create a new field.  The relative_time function can be used to compute a new timestamp using another timestamp and an interval.

| eval StarTime = relative_time(now(), "-7d@d")

 

---
If this reply helps you, Karma would be appreciated.

ITWhisperer
SplunkTrust
SplunkTrust
| eval StartTime=relative_time(now(),"-7d@d")
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...