Knowledge Management

Can you do a multiline eval command in a datamodel for an eval field?

ebs
Communicator

Whenever I've created eval fields before in a data model they're just a single command. Is it possible to do a multiline eval command for a field? This is what I want to make into a single field:

| eval AEST_time=_time+36000
| convert timeformat="%Y-%m-%dT%H:%M:%S.%3Q %Z" ctime(AEST_time)
| eval epoch=strptime(AEST_time, "%Y-%m-%dT%H:%M:%S.%3Q %Z")
| eval date=strftime(epoch, "%Y-%m-%d")

Labels (3)
0 Karma
1 Solution

venkatasri
SplunkTrust
SplunkTrust

Hi @ebs 

You shall get the same output with this, when you add something to _time it will be by default coverted to ePoch

 

| eval date=strftime(toNumber(_time+36000), "%Y-%m-%d")

 

 

View solution in original post

venkatasri
SplunkTrust
SplunkTrust

Hi @ebs 

You shall get the same output with this, when you add something to _time it will be by default coverted to ePoch

 

| eval date=strftime(toNumber(_time+36000), "%Y-%m-%d")

 

 

ebs
Communicator

Thanks!

0 Karma
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 ...