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!

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...