Knowledge Management

How to pass variable to collect argument "file"?

morethanyell
Builder

Hi,

How can I pass the epoch time now() to the file argument of collect?

| ...
| collect spool=t addtime=t index="ourindex" file="[here, the current time here please thanks]_event.stash_new"
0 Karma
1 Solution

morethanyell
Builder

this

| ...
| collect spool=t addtime=t index="ourindex" 
    [ | makeresults
    | eval retval = "file=" . strftime(now(), "%s") . "_event.stash_new"
    | return $retval ]

View solution in original post

0 Karma

morethanyell
Builder

this

| ...
| collect spool=t addtime=t index="ourindex" 
    [ | makeresults
    | eval retval = "file=" . strftime(now(), "%s") . "_event.stash_new"
    | return $retval ]
0 Karma
Get Updates on the Splunk Community!

Using Machine Learning for Hunting Security Threats

WATCH NOW Seeing the exponential hike in global cyber threat spectrum, organizations are now striving more for ...

Observability Newsletter Highlights | March 2023

 March 2023 | Check out the latest and greatestSplunk APM's New Tag Filter ExperienceSplunk APM has updated ...

Security Newsletter Updates | March 2023

 March 2023 | Check out the latest and greatestUnify Your Security Operations with Splunk Mission Control The ...